Skye Terrier monument
EDINBURGH, SCOTLAND: Bobby a Skye Terrier monument. A French historian studies the relationship between ancient stories told about dogs and information from genetics and archeology.
Just how and when dogs originated has been the subject of much research. In one account, "Dogs originated from wolves domesticated in Europe, 19,000-32,000 years ago," based on DNA studies (2013). But other research points to many other possibilities: "Central Asia, the Middle East, South Asia or Southeast Asia" some time between 10,000 and 38,000 years ago. Some think they were tamed twice.
dog cave sketch
Polychrome tracing by archaeologist Henri Breuil from a
cave painting of a wolf-like canid, Font-de-Gaume cave,
Dordogne, France dated 17,000 years ago.
Historian Julien d'Huy of the College of France in Paris suggests another approach, looking at stories about dogs:
"With mythology, we can have explanations of archaeology, we can have reasons for domestication, we can test hypotheses," he says.

D'Huy found three core storylines for the earliest myths related to dogs: The first links dogs with the afterlife, the second relates to the union of humans and dogs, and the third associates a dog with the star Sirius. Versions of these stories are found in many cultural regions around the world. He then borrowed statistical tools from biology to create family trees of myths, showing how the stories evolved as they followed humans from one region of the world to another.

Elyse DeFranco, "How mythology could help demystify dog domestication" at Science News (September 7, 2022)
Oh but that's just mythology, right? Well yes, but many myths originate in real world experiences. If people tell stories about dogs, that's probably because there are dogs in their environment. After all, dogs aren't dreadful like dragons or supernatural like fairies. So if you wanted to gain a large following as a storyteller in antiquity, you'd only include dogs — or wolves or rabbits, for that matter — if they were animals people already related to. Here's what D'Huy proposes:
Folktales about dogs stemmed from Central and Eastern Asia and spread to Europe, the Americas and later Australia and Africa, d'Huy reports in the June Anthropozoologica. This mythological travel route parallels a proposed path of dog domestication borne out by genetic and fossil evidence.

Elyse DeFranco, "How mythology could help demystify dog domestication" at Science News (September 7, 2022) The paper requires a fee or subscription.
D'Huy points to the grave from 14,000 in what is now Germany which held a couple and two dogs. The woman's hand was resting on the head of one of the dogs. There must have been a story there.

The fact that we have had a special relationship with dogs for a very long time is attested by the sheer number of dog burial sites, some of which include grave gifts left for the dogs:


Grave gifts imply, among other things, a future in which the deceased will need the gifts.

Some other thoughts about our relationship with dogs:

We may choose them in part in order to communicate:
We signal our class, our preferences and our personality through our choice of dog as a pet. By choosing a Labrador, an owner may be signalling their suburban lifestyle or traditional values. The semiotics of dog ownership relates to both our communication with the dog, as we name and treat it, and our communication to the rest of society of what our possession means. And this meaning has changed through the co-evolution of our relationship with animals, much as dogs themselves are sometimes regarded as having domesticated themselves in their affiliation with humans. That it was not our choice but theirs...

Dogs are, in a Barthesian sense, the signifier and the signified. They straddle a line between self and other (in the ways we have 'humanised' them, yet use them as objects). If I tell you someone has a pet pitbull, you might make assumptions about this person - very different from the assumptions you'd make about an acquaintance with a Yorkshire terrier. Breeds have accrued associations, from their presence in popular culture, to their phenotype, to our familiarity with them in daily life. Simply owning a dog is an exercise in expressing our cultural values, as our furry totem reflects them to the world.

Katrina Gulliver, "Semiotics of dogs" at Aeon (August 4, 2022)
Dogs, some researchers now think, learned to get along with us simply because they stopped being afraid of us:
In a review published last week in the journal Trends in Cognitive Sciences, researchers Friederike Range and Sarah Marshall-Pescini of the Konrad Lorenz Institute of Ethology at the University of Veterinary Medicine in Vienna questioned whether dogs really are less aggressive and show more advanced social thinking abilities than modern-day wolves, thus challenging some basic tenets of dog domestication...

Together, recent science suggests that dog domestication didn't lead to less aggression or enhanced socio-cognitive abilities. Rather, domestication may have simply made dogs less fearful and more subservient. "Compared with wolves, dogs seek to avoid conflicts... and might have an increased inclination to follow rules, making them amenable social partners," the researchers wrote.

Ross Pomeroy, "The "mean wolf to friendly dog" domestication story might be wrong" at Big Think (February 15, 2022) The paper is open access.
And we are asked to credit the role of dog trainers as well as researchers in helping us understand our dogs:
A rich literature now exists on topics such as the limits of canine vocabularies - some dogs can learn up to 1,000 words. In addition to detour experiments, researchers have investigated whether dogs are good at teamwork with other dogs, and how they handle difficult or impossible tasks. (Unlike wolves, dogs tend to give up and ask humans for help.)

But dog trainers, not academic researchers, were the first to try expanding canine vocabularies into the realm of hundreds of words, not to mention tackling the question of how to convince dogs to persist at solving difficult tasks. More and more, people who train dogs are pushing the limits of what dogs can learn. In the past few years, for example, 'concept training' has become popular - teaching dogs a set of rules instead of a specific action. One application of this training is 'match to sample', in which the dog has to match two objects based on an attribute such as shape, size or colour. Another is 'modifier words', such as 'slowly', 'quickly', 'left' or 'right'. The dog has to apply these words to other commands: heel, but do it slowly. Retrieve the object on the left.

Jessica Hekman, "Canine exceptionalism" at Big Think (November 25, 2019)
For a dog, perhaps it is a bit like going to a good school.
You may also wish to read:

Study: Dogs cry for joy as well as pain. Recent research has focused on how dogs respond to the world they share with us. Researchers also found evidence that dogs mourn when close companion dogs die — and that more playful dogs were better problem-solvers.

and

Can old dogs learn new tricks? Scientists aim to find out. Not much is known for sure about how dogs age. The Dog Aging Project aims to change that through systematic research programs. Aging dogs, according to recent research, can learn new tricks — but it depends on the trick. Also, dogs fed only once a day have been found to age more slowly.