It was approximately 15,000 years ago that our dogs began their evolution from wild wolf to domesticated dog. There is some disagreement as to the exact location of the first domesticated dog but no matter how long or where they first started all of our dogs evolved from wolves. You can see the genetic similiarities in looks and behavior. Watching a pack of dogs or a pack of wolves is very similar.
So how the heck did we end up with so many different looking dogs? We humans like what we like correct? As the dog worked it's way into more and more human lives; these humans started to pick and choose traits they either liked visually or found useful. Traits such as good hunters, gentle with humans, cute ears etc were specifically chosen and the dogs who had these traits were the ones who were bred with other dogs who had desirable traits. Thus the pick and choose process began.
Once dogs were found to be good little companion; humans started breeding down in size so these cute little munchkins could sit on the elite laps. Where there was a need a dog was bred to fill that need; hunting dogs were bred by picking the superior scent or sight dogs. The evolution continued over thousands of years to now; there are dogs for everything. We have herding dogs; scent hounds, sight hounds, companion dogs, go to ground dogs, gentle lap dogs who's natural prey drive are nearly all but eliminated.
But beneath all of dogs lies the genetic pathway to the wolf; a wolf in dogs clothing. We humans can often humanize our dogs; we dress them and expect them to act as humans in our human world. They are often discarded as "bad dogs" when they act as dogs and not humans. Most humans do not come with the built in ability to understand dog behavior yet almost all humans want to live with dogs. It is in our best interest to learn as much as we can before attempting to live with a dog in our human world. Afterall there are wolves lurking in there.