I’d say dog breeds can come from stray dogs but in the sense of that stray dogs (and stray cats) occupy niches depending on occupation and degree of socialisation to people. You have owned dogs straying at will, stray dogs being habituated with humans to some extent, owned dogs roaming around in compounds and villages/farms and completely feral dogs (same with cats). Dog breeds as we know it came much more recently.
Had dogs been around for almost 20,000 years, dog breeds would’ve come much later really. Especially when it comes to regulating breeding and even then this is something rich people (even today) can afford to do and cope with. From my personal experience as well as from what I’ve read from German sources, the stingier or poorer people stick to mongrels. Not that they’re any healthier but they’re generally easier on the budget.
That and dogs being made to stay outside for long out of hygienic reasons can make canine commensalism an inevitability though the degree of socialisation to people in tandem with occupied niches can shape dog breeds.