The reason this works quite well routinely, is because dogs have been purposely redesigned to be devoted to their humans and will seek human companionship. If left alone in nature, a dog may well bond to other animals or to other wild dogs given the opportunity, but there will still be a longing for humans in the makeup and they may well reacquire a human and want to be with them. So this is not a liability or a penalty, it is, in effect, the natural habitat of man’s best friend, so to speak, because they feel at home with humans and are highly attuned to wanting to be in a relationship and will accept multiple humans as members of the pack, so to speak, and share their time and energies with all, much as wild dogs will form a pack and spend time together as this is of mutual benefit for a number of reasons in addition to companionship, because they are a more effective hunting force working together to surround prey, and so forth, as well as scouting for food and safe living quarters, and so on. When those needs are met by loving humans, dogs will thrive. This is in sharp contrast to any kind of wild animal that is kept as a pet but will escape and flee given any opportunity. Dogs, on the other hand, might well roam if they are allowed out on their own, perhaps inadvertently, but if there has been any time for bonding to the human owners, they will return as a result of wanting to be with them.