According to this fascinating article,
The Big Search to Find Out Where Dogs Come From, well worth the time to read, dogs "(a)t some point, they became the tail-wagging beggar now celebrated as man’s best friend, that 'best friend' is not an 'ecological definition'" and that "the domestic house dog may have evolved into a parasite."
My own view is that the relationship is symbiotic. Dogs are not purely parasites since they are useful to man, both for pragmatic reasons and as companions. Pragmatically dogs guide the blind, herd cattle and sheep, retrieve ducks from lakes and rivers, and rescue people from avalanches. Among other useful functions.
From a companionship point of view what more need be said than the smile they put on people's faces when they come home from work. Or the comfort that a dog's head in your lap gives you after a bad day. Or therapy dogs that calm stressed out people.
I agree that dogs self-selected man. But man could not have gotten to where it is without that dogs. Encampments could grow into villages when protected. So both dog and man got a good deal.