We have a great deal of evidence showing that dogs lived alongside humans very far into the prehistoric past. There are burial sites with dogs buried alongside humans dating back to long before the beginning of agriculture.
However, there is little evidence to support the idea that dogs were originally domesticated in order to help with hunting. This is the kind of heroic macho mythology that people loved 50-100 years ago, along with imagery of "cave-men" hunting mammoths. There are other hypotheses, including the idea that dogs have basically evolved as parasites whose niche involves hanging around humans and waiting for food to come to them.
Dogs and wolves have a pretty close common ancestor, although it may not be true that dogs evolved from anything closely resembling a modern wolf. It's very instructive to look at the differences in reproduction and nurturing of pups between dogs and wolves. Wolves form nuclear families and care intensively for their pups for a couple of years, and this is necessary because wolves are hunting animals, so the pups can't survive unless they're able to hunt on their own. Dogs mate promiscuously, pump out large litters frequently, and push their puppies out on their own very early without devoting a lot of time and energy to their care. Male dogs do not care for their offspring, and it is even common for puppies from the same litter to have different fathers. This is a clear evolutionary difference from wolves, and it makes a lot of sense if you think of dogs as parasites rather than hunters. At the age of 6 months, a wolf pup can't bring down a moose, but a dog puppy at that age is very cute and may be lucky enough to latch on to a human household that will feed it scraps.
Dogs also have specific evolutionary traits that make them well suited for eating human scraps. They are able to digest starches better than wolves can. This does not really point to a role for dogs as hunters but rather as parasites dependent on humans for food.
Even if dogs are basically parasites on humans who aren't evolved for hunting for their own survival, it could also be true that part of their parasitism on humans involves making them useful to humans as helpers in hunting. But we just don't have any solid evidence that this was the origin-story of the dog-human relationship. If you look at dogs around the world today, very few of them help in functions like hunting or herding, nor are very many pet dogs that live in a house. About 3/4 are dogs that run loose and have no owner -- e.g., village dogs in the third world, or the kind of dogs that hang around a dump in Mexico City.
A recent book on this topic is What is a dog? by Coppinger and Coppinger.