There was a study stating that people love dogs more than any other animal though I suspect that would’ve been based on a limited sample and might not be applicable to every other place or community. Though this might not always exactly be the case, there are instances, attitudes and beliefs that determine the degree of attachment.
If dogs were often meant for more practical purposes and allowed to stay outside longer, it should be generally inevitable that one would have to be less attached to dogs especially if certain situations arise. There was a study in Botoku, Ghana about hunters who were attached to dogs had to let them go and they did.
I do recall a Ugandan account of people who make their dogs hunt by starving them and similar things happened in the Beng community in Cote d’Ivoire. Then you have religious beliefs that control this. Like I said, it’s not just Muslims that are uncertain around dogs but also Christians and Jews.
In fact, the Catholic Church banned nuns from owning animals (save for cats at least in England) and they banned them from owning dogs in 18th century Naples. The Armenian church at some point abhorred both dogs and donkeys as well as Armenian beliefs of the Devil appearing as a dog (very common in Western Eurasia especially in tandem with witch dogs).
The belief in demonic and witch-dogs is still around in Pentecostal or African Initiated churches in Uganda, Zambia, South Africa, Cameroon, Cote d’Ivoire and Democratic Republic of Congo. I remember a document where it mentions dogs being associated with hatred, prostitution and witchcraft.
Could be wrong though but there’s another document in that country where children accused of witchcraft were assumed to turn into dogs, alleged former witch-doctors using dogs and bewitching dogs biting people at least in Matadi. Similar beliefs occur in Cameroon and Ghana to whatever degree.
In that context, it makes sense why eighteenth century people were uncomfortable with owners who get too affectionate with their dogs, especially if they’re (made) useless almost as if the only real use for them at all is sexual. There’s the old stereotype of the old maid and her lapdog, probably best known to Hispanophones as Dona Clotilde from El Chavo del Ocho.
(There’s an earlier version of the stereotype where women are accused of witchcraft if they have sex with dogs, presumed to be demonic guises, at all.)
Keep in mind that in those days that even if dogs’ positive qualities were recognised, these were also equally undercut by beliefs in dogs being witches, demons or the Devil in disguise based on two French documents I’ve read. Dogs, like cats, arouse polarising attitudes in Abrahamic faiths best exemplified by that both clergy and witches own them.
Like I said, secularism has something to do with weakening negative attitudes to dogs. After all, European churches used to have the habit of driving away dogs by force and dogs are still forbidden in Orthodox churches. There’s an account where dogs are driven away in Pentecostal Ghanaian churches for fear that they’ll be demonically possessed.
Again this isn’t always the case depending on the individual itself but when taken as a whole there are glaring differences between how communities treat and view dogs. Christianity, like Islam, is rather ambivalent around dogs noting their positive qualities but still suspecting them of witchcraft and being in alliance with the Devil.