No, please don't eat your dog! I mean Paleolithic man was already domesticating canis lupus familiaris - the 'dawg' ;). Early man would take whatever help they could get - such as following scavenging birds to recent kills, or watching fleeing prey to get a head start on fleeing themselves! When wolves came close foraging through our trash, they would eventually trust some humans and vice versa. According to Steven Hawking, without writing a species learns ONE bit of information er generation. Dogs learned bit by bit that their relationship with man could be symbiotic. They help support us in a hunt and we'd share the spoils. It was a somewhat simple migration of logic, they are pack animals, and man seemed dominate and a leader to them.
In the 1950s, an interesting experiment was done in Russia. Wild foxes were bred for friendliness, and within a very short time (only 5-10 generations), the foxes not only became very friendly, but they developed very dog-like appearances. Floppy ears, big eyes, and unfoxlike colors. The conclusion of this experiement was that what was needed for this 'obedience' or coexistence with man was their 'eternal' immaturity. It's similar to the story of how you can live with a chimpanzee until it hits puberty - after that it's as likely to tear your face off as it is to play with you.
Dogs have been with us so long, their relationship extends beyond perpetual immaturity. Recent experiments show the capability of a dog to understand a human goes much further. A dog is the ONLY animal that understands that we're pointing to something. They are 'eye' focussed when looking at us. Try this, if you have a dog, just keep looking to one direction and see if they get curious to what's over there. This coexisting relationship is long process and it flooded me when i went on a run with my dog today. She's been living alone with my son for a while. She's not very leash trained and HATES other dogs. I swear, if I took her off the leash she'd "escape" or get hit by a car :(. BUT... when we run together, it comes ALL together. She notices a me making a subtle change in direction and is happy to oblige, her face is lit up in what seems like a smile (sorry for the personification) and tongue out for cooling. If she heads the wrong way in the woods, a small click from me and she bounds my way. It is as if she and I are 'on the hunt' and she knows it! Your dog knows that feeling, maybe better than YOU do. Take your dog out and show him/her a sample of their past - make them think you're on the hunt.
Sources: The Human Spark, The Origin of the Domestic Dog, Jessie-Girl the animal-dog