Once upon a time, many eons ago, humans and canines led totally separate lives. The humans hunted using various hand made weapons, and the dogs, reunited in packs, used their powerful teeth. It all stayed this way until towards the end of the Ice Age around 12,000 BC both humans and dogs came to realize that mutual benefit could have derived from their companionship.
Dogs for once, realized the advantage of having access to a reliable source of food and came to appreciate the luxury of warmth and shelter. Humans on the other hand, found helpful collaborators in hunting, and later, the dog's herding and guarding qualities were strongly appreciated.
Perhaps one of the many reasons which made dogs feel comfortable living among humans, was the fact that they were quite gregarious beings used to living in a pack. Prior to domestication, dogs used to aggregate with other dogs of different gender and age and were accustomed to having a leader to whom the were submissive.With humans, the same dynamics remained, they were servant and submissive to their human leaders and they enjoyed leading social lives.
At a closer look, modern dogs belong to the family of Canidae, carniverous creatures encompassing 38 species. Their communication is based primarily of body language, facial expressions and limited vocalization. There are diverse theories on the dog's evolution. In most cases, there are claims that the ancestor of the dog was the wolf, (Canis Lupus), however, it could be the wolf was not the only ancestor. There are theories about the inclusion of other species resembling dogs and related to the wolf.
Wolves and dogs have basically great similarities in their DNA, indeed, dogs and wolves can successfully breed and produce fertile specimens able to breed as well. Studies on wolf behaviors therefore may be helpful on deriving insights on dog behaviors. However, one must not focus mainly on the study of wolves to come to conclusions about today's dog behavior. Doing so would be quite like comparing chimp behaviors with humans, both species certainly being miles away from being similar in many ways!
There have been archaeological findings of dogs buried along with humans from 14,000 years ago. This was proof that back in those times, dogs were valued and perceived already as loyal companions. Still as of today, this legacy continues, both humans and dogs teaming up and enjoying each other's company, yet under totally different circumstances.