No one knows exactly where dogs come from. Evidence of dogs coming from the Middle East and Asia has been found in DNA studies, yet the first dog fossils were found in Europe. It is not even agreed upon as to when the first dogs came into existence, as some data suggests 130,000 years ago, while other data suggests a period of approximately 19,000 to 32,000 years ago.
However, there is one common thread that prevails about dogs' origins. They originated from the grey wolf and occurred due to the adaptation of the grey wolf to the human population. This was likely encouraged by the human domestication of the wolf.