In addition to Nai54's excellent answer, I want to concentrate on the "code" the dog acts on.
Many children have the instinct to pet animals on their heads, because that's what they see in TV and images. But for a dog a hand that is approaching their head from above can seem very scary and intimidating. You should teach your son to never pet a dog on the top of the head, always on the side of the shoulder or front of the breast.
Do a little role play with your son. He plays the dog (crouching on the floor) and you play your son trying to pet him. Look him in the eyes and move your hand towards his forehead from above. Then ask him if he felt good or bad. Repeat the same play, but this time pet him on the cheek from the side. Ask him how this felt in comparison. This first hand experience is ideal to make him understand dogs and remember not to pet the dogs' head.
Here's a graphic that shows the most common errors people do when meeting dogs:
It's best to teach your child a "dog etiquette" in comparison to our human etiquette:
- If two people meet, they shake hands to say hello. Dogs don't have hands to shake, but they sniff each other to say hello. If your son meets a dog, he should first crouch or kneel down beside the dog and present his hand to be sniffed without trying to touch the dog. You can see the correct stance in this presentation on slide 18.
- Once the dog sniffed his hand and thus said hello, he can ask the dog if it wants to be pet. Since the dog cannot understand human language, your son should pet the side of the shoulder or the breast in front of the front legs for 3 seconds. If the dog moves away, it doesn't want to be pet. Otherwise it's okay with being pet. See how this 3 second rule works in this video.
- After your son has introduced himself so friendly to the dog, and if the dog doesn't move away, he can continue petting the dog for another 3 seconds and then see if the dog wants more or moves away.
This comparison makes the rules of introduction easy to understand for a child. In reality they allow the dog to build trust in your son by
- Avoiding intimidating body language.
- Getting to know him (by his smell) before being touched.
- Experiencing that your son is not intrusive or intimidating by going for the top of the head first or holding the dog against its will.