and are raised with love, both given to them, and reciprocated by them. I was just looking at my indoor-only cats, how a feral colony's kittens were brought inside and tamed by bottle feeding, and taught to trust humans. If cops were to come inside and shoot them, I'd feel so bad, not only for me, but I'd feel bad about having taught them that humans were good and could be trusted to love them, only for their last moments to realize that humans could not be trusted to love them.
With dogs, it is similar. While not everyone does this, many dogs are put through socialization and later obedience classes or training. They are also taught to love humans and other dogs. When they're in their backyards, usually alone, they will be protective of their area, it is the nature of dogs to do so, even when they've been through socialization and obedience training. Yes, they will bark, some breeds more than others. Again, here are animals who were raised with love, and taught that humans were okay, and in their last moments betrayed, murdered by humans. Imagine the horror they must feel in their last moments, and their confusion, "I thought humans loved me."