While some suggest that the idea of keeping a dog as a companion and the positive connotations with dogs may’ve started in the West, this is only partly correct especially when you bring up that dogs are frequently mentioned in earlier documents as both witches’ familiars and guises (as well as demons’ and the Devil’s favourite guise). A woman would be accused of witchcraft if she had sex with a dog.
Though the dogs’ demonic association eventually subsided, the suspicion (and disdain) towards excessive closeness to dogs still lingered especially towards lapdogs in the 18th century. It’s telling that even if keeping dogs for companionship’s increasingly common, there are still people who keep dogs for guarding and hunting as well as dog owners who let them stray/stay outside and owners who aren’t close to their dogs.
The belief in demonic and witch dogs still occurs in Ghana, Zambia, Cote d’Ivoire and Cameroon among other places. Especially among Pentecostal Churches. Not that this hasn’t stopped people from owning dogs but it’s parsimonious to suggest that secularism may’ve helped turn the dog’s reputation around especially with Christianity’s decline in the West and rise in the South.
Historically, churches employed people to eliminate dogs and dogs are still forbidden in Orthodox churches. In the like manner, various African Pentecostal churches accuse dogs of witchcraft. Not necessarily always the case but it seems a strong belief in Christianity (though depending on the locale) has a profound effect on attitudes to dogs.
This also goes hand in hand with how socialised the dog is to people. If the dog’s owned but spends a lot of its time outside then it’s inevitable that people would be weirded out by excessive emotional attachment to dogs like it occurred in 18th century Europe.