Birdie, how old is she? Young children don't comprehend a lot of more complex concepts. We, as adults, know that not every animal wants to be smothered with kisses and huge, but it's hard for kids to understand that.
Maybe you could practice on stuffed animals first. Show her how to pet the animal. Just realize that, depending on her age, she may not be too coordinated and that the petting may not be so gentle.
Read books with her about animals and how to treat them. Model behavior for her.
Mostly it'll probably just take some time. As she gets older, she'll be more coordinated and can control her movements more. This will allow her to pet a cat or a dog in a gentler manner. Her comprehension will also improve, so you'll be able to explain to her that not all cats and dogs want tons of affection.