Somewhat odd but also helpful in understanding why dogs would have a very polarising reputation in Christianity and Islam. The very animals that alternate between valuable sentinels and witches’ familiars. Again this is not always the case but parsimonious to suggest that if sheep are heavily linked to Jesus and Christians in the sense of having true devotion to the shepherd (as one at Sheep Like Faith notes), then dogs would be their near opposite by being both their protectors and killers.
Parsimoniously thinking, if the Church is referred to the Bride then the woman becoming too affectionate with the dog (The Devil’s favourite vessel) then she’ll be accused of bestiality and witchcraft. Even further back, there was a time when Romans celebrated geese for protecting them from harm (which the dogs were supposed to do and got crucified for failing to do so). In Mesopotamia and Sumeria, dogs were alternately benevolent (Gula) and malevolent (Lamashtu).
If sheep are truly devoted to their own masters moreso than dogs (thus being a better model of loyalty as they distrust anybody else), it’s parsimonious to suggest that dogs would be better associated with caution. Be cautious around an unfamiliar owned dog as well as dogs that might kill livestock as the dog is cautious of anything unfamiliar (however to a point as they can be manipulated against their will, whether by witches or criminals).
The dogs’ loyalty did get valued but it also got undercut by suspicions of witchcraft and devilry, far more so than with sheep. That isn’t always the case as there are some cases that mention both sheep and dogs to demonic or demonically possessed. But dogs are likelier to be considered demonic than sheep are, hence the former’s rather ambivalent reputation like with cats.