Its pretty obvious that humans and dogs have been together for a very long time. I personally think it began as an unintentional interaction with both scavenging kills from larger predators and what was left behind by each other.
Yes, and the propensity of humans to nurture small cute baby animals (if they didn’t eat them). I think it’s quite likely that on occasion young wolves were found minus parents and brought back as entertainment to the hearth. At some point, some of them were useful as adults for keeping away other animals, cleaning up refuse, etc and a partnership was born. Dog society is similar to human society, so they fit well.
At least my dog says so.