The domestication of the dog, like the domestication of all species, is still the topic of fairly hot research, but it's very clear that when they were first domesticated, there were no 'breeds'. Breeds as we know them today emerged very recently.
Take a look at Xenophon's book on dogs, Cynogeticus. Spartan dogs "Laconians" were famous and must to some extent have bred true because he presents a profile of the type. Rather than a "breed" like todays designer show dogs, these would be like modern dogs that are still used to work- take a look at Curs from the US. These dogs have a recognizable type, but owners will sometimes out breed them to things like pit bulls if they get too inbred and light boned. That blood works its way into the breed over a few generations without major changes in form.