Yes!
It is safe for your dog to have benadryl. Benadryl (diphenhydramine) is a medicine, and like all medicines, should be used carefully under the guidance of a veterinarian. Proper dosage is very important and will depend on the dog's size and tolerance.