Dogs have been around people since our hunter-gatherer days and are the first species to be domesticated.
There are several theories as to how. Humans and canines both hunted the same kinds of animals and had frequent contact; another theory suggests that wolves less afraid of humans would approach discarded carcasses for food, eventually evolving mutually with people.