Friends are friends and these two dogs show it best.
Dogs hug each other through mounting or placing a paw on another dog's neck and back. In some cases, a dog's owner may teach the dog to hug by slowly giving him or her brief touches. When they hug human beings, they tend to cuddle up to them.
Dogs do NOT hug each other in the wild! When one dog grabs another dog it is usually a sexual or dominant advance. Dogs also do not generally like restraint, and hugging feels a lot like restraining movement.