Dogs, really do not like hugs.
While some dogs, especially those trained as therapy dogs, can tolerate it, in general, dogs do not enjoy this interaction. Dogs rely on body language as a method of communication with humans and each other. Putting a limb over another dog is a way of exerting dominance and can be confusing and intimidating. Often you'll notice a dog become stiff or still when being hugged, signs that he is not having a great time.
That's not to say they don't love affection from their people. Some absolutely adore cuddles, but most dogs prefer a belly rub or a back scratch to a squeeze. Also, the act of hugging requires that the person puts their face next to a dog, which can be dangerous.
Parents should teach children about the proper ways to approach and pet a dog, especially one they've never met before, to avoid any accidental injury.