I was bit by a puppy as a child and have the scar on my lip to prove it!
With my own kids, I have drilled into them that they should never pet a strange dog without the owner's permission (and was very proud when DS5 asked someone once if he could pet her dog

) and they also know the proper way to pet a kitty ("head to tail, right Mommy?"). It's parenting 101 - keep your kids safe.