Dogs were the first domesticated animal, and the only one domesticated by hunter-gatherers rather than by farmers. Genetic estimates of the divergence from wolves range from roughly fifteen to over thirty thousand years ago, with the wide range reflecting real disagreement about mutation rates and about whether domestication happened once or more than once. The Bonn-Oberkassel burial in Germany, in which a dog was interred with two humans about 14,200 years ago and shows evidence of having been nursed through distemper, is among the earliest unambiguous evidence of the relationship being more than utilitarian.
Domestication changed the animal cognitively. Dogs follow human pointing and gaze in ways wolves raised identically do not, and they look to human faces when a problem becomes unsolvable rather than continuing to work at it. Mutual gaze between dog and owner raises oxytocin in both, a loop otherwise documented between parents and infants.
Islam. The position is more nuanced than either its critics or its defenders usually allow. Most schools of jurisprudence treat the dog's saliva as ritually impure, requiring washing before prayer, and keeping dogs indoors without purpose is discouraged; the Maliki school is notably less restrictive. Hunting and guard dogs are explicitly permitted, and the Quran approves of what trained dogs catch at 5:4. Against this, the Quran speaks warmly of the dog of the Companions of the Cave at Surah 18:18, lying at the entrance with them, and a well-known hadith describes a sinner forgiven for giving water to a thirsty dog. Cruelty is prohibited. The blanket claim that Islam regards dogs as unclean animals to be shunned flattens a genuine range of positions.