When I was in school, people thought I was weird because I could get birds and squirrels and other animals to come up and sit with me. A guy in my class said it's like they trust me because they can feel how much I love them. I've never been bitten or stung or even came close. A raccoon living in my yard trusted me enough to let me hold her babies. It's weird, like I have a connection with them. I can FEEL their feelings. I've been face to face with bears and wolves and never once felt any animosity or anger coming from them. Curiosity, maybe.
Animals can sense trust and love, and you'll only get it by giving it in return.
Humans are the only animals that hold grudges. All the hatred in the world comes from us.
Also, regarding "racist" dogs. Like humans, that entirely depends on how they were raised.