Dogs are probably the descendants of the gray wolf.
The first demonstrable signs of relationships between man and
wolves date back to 10.000 to 15.000 years ago.

The gray wolf, the most probable ancestor
of all current dog breeds
It's not certain whether man approached the wolf,
or vice versa. Both profited from the new situation: people used
wolves during the hunt, for keeping flocks together and to warn
against approaching enemies. Man in turn, made sure his wolves
were fed.
Wolves are very social animals. Like humans, they
live in groups (called packs) with social ranks, in which some
wolves claim leadership. This made this animal suitable and attractive
as a companion, because wolves accepted man as their leader. Requirements
with regard to behavior and appearance of wolves started to change.