Dogs go by instinct...and it's also genetic. Certain breeds back in the day were bred especially to chase and maul a black person...german shepards in particular.
IMO...it's based on instinct and genetics.
Not really.
Dogs are creatures of habit. When something unfamiliar enters the environment it gets them upset.