Scientists have now confirmed that dogs can recognize a bad person
Can dogs tell if someone is a good person? Hmm...Well, the simple answer is an unequivocal yes. One of the many reasons dogs are incredible beings is their ability to notice and respond to the physical cues of humans, It is like their 6th sense. We as humans don't always see these cues the same ways dogs do. Dogs can sense from a human's overall body language and energy can recognize if they are "good" or "bad".
If a person is acting nervous or anxious, angry or hostile they put off a type of energy much like if a person is speaking loudly or making wild gestures. This will put the dog on alert, making them uncomfortable and nervous themselves, which may cause the dog to react violently or angrily.
As a proud owner of 3 dogs I would have to agree that dogs tend to recognize when a person has bad motives. When someone is calm and collected and doesn't seem to have bad motives, our 3 cuties are pretty calm and keep in mind, they are very easy to trigger and they love barking. However, when someone is acting with anger and anxiousness, they immediately sense that and start barking.
Dogs are a lot smarter than we tend to think, for example, one time I was in my car with our doggies and they were all laying down, not even looking out the window or anything like that, and when a small chihuahua walked by (keep in mind you couldn't hear the dog or notice it at all), they all started barking. I'm telling you, these furry friends have a very sharp sense and they notice everything.
Another great example of this is when I crack open a tuna can. My dog Ralph loves fish, and this one day he was in the bedroom and I was in the kitchen, I barely punctured a tuna can, and when I turned around Ralph was standing behind me wagging his tail and licking his lips.