Children generally love dogs, but unfortunately, in their enthusiasm, they often do all the wrong things (from the dog's point of view) when meeting a new dog. Teach your child how to "talk dog" and increase the probability of their having successful encounters while reducing their risk of being bitten.
Never let your child run right up to a strange dog. It's always better to ask, "Is he friendly? Is it OK if I pet him?" first. If it is service dog, read his vest. Typically a working service dog's vest will read, "Pet me, I'm Friendly" or else, "Please Don't Pet - I'm Working."
If the child is taller than the dog, you have a circumstance where the dog may feel intimidated by this person looming over him. Teach the child to squat down, turn their body slightly sideways, and to hold out their hand, down low for the dog to sniff, before petting his chest.
Putting yourself over the top of the dog, in dog language, announces, "I'm the boss of you!" Teach children instead, to pet the dog's chest area first. A friendly dog will quickly let you pet him anywhere, but the first contact is best made on the chest.
Staring at a dog directly in the eyes (as we're taught to do with humans) can be interpreted as a challenge. Many children want to pet the top of a dog's head while staring at it in the eyes. Go easy on the eye contact.
Particularly if your child is afraid of dogs, teach him to never run away from a dog that approaches him. Many dogs have a hardwired "prey drive" that kicks in whenever they see something moving quickly away. This is what motivates dogs to chase rabbits, cars, etc. Instead, teach your child to stand his ground. If it a friendly dog, teach them to simply stand there, arms crossed, making no eye contact ... the dog will sniff them and most likely leave. If the dog seems aggressive, taking a step TOWARDS the dog, making eye contact and saying in a loud and authoritative voice, "NO!" is their best bet for causing that dog to leave them alone.
select one here...