I'm going to keep this short- because I want everyone to read it...
If you ever have the opportunity to watch a very dominant dog meet another dog, you might see a behavior that I call "necking." The dominant dog will lay his neck over the other dog's shoulders or back and press down. It is a body language that tests the other dog's temperament and says "I'm the BOSS... what are you going to do about it?"
When a child leans over a dog to hug it, this behavior can be interpreted as a challenge by the dog.
Your dog may be very tolerant and enjoy this kind of affection from your child. But your child needs to understand boundaries when interacting with other people's dogs.
And as dog owners, we also need to teach children who interact with our dog, that hugging or laying on or - heaven forbid- sitting on a dog is never ok. I insist that children sit down and my dog sits so that they can interact safely. I don't want the child to trip over or step on a tail or fall against my dog.
This may seem like an "eye roller" post to some, but I've seen way to many children injured and good dogs having to be euthanized because a child simply did not understand the message that they were innocently sending a dog.
HUGGING = NECKING Maybe the dog will accept it. Maybe he won't. Maybe yours will. Maybe the next one won't.