Many scientists believe that dogs domesticated themselves, too. The old theory was that people adopted wolf puppies, but wild wolves would have been hard to domesticate and would make bad pets. Instead, what may have happened over thousands of years is that wolves followed bands of humans around on their hunts, and hung out at their campsites, eating the discarded bones and other detritus. Over time, they became more domesticated, and man started appreciating the benefit of having a warning every time danger approached. The dogs that survived were the ones who could not only get along with humans, but understand their behavior. My dog knows when I’m going to my car; the ancient wolves would know when the Geico guys were about to go on a hunt.
There's some evidence that humans have developed some special way of understanding dogs too...in other words, it goes both ways. Humans and dogs have been linked for a very long time, and dogs very distinctly incorporate humans into their pack structure.