It's possible that some of it is instinctual, since man and dog have had such a close relationship for so long a time. There is plenty of other things we've changed about dogs, down to the basest level. So it's possible that we've also bred in an instinct about how to react with humans.
However, I think the vast majority of it is learned behavior. As an example, just think of the people you know. I bet that every person who reads this will know at least one person who is loud, mouthy, and aggressive sounding, but you know that they don't mean it. Conversely, you probably also know a person who is fairly quiet, but when they yell or curse, you really take note and it's almost shocking. Since people are so different from one another, you can't really breed in a reaction to human behavior. It's based on the individual person.
Also, you use a stray dog as an example, but I think it would be a very, very small portion of stray dogs that haven't come into contact with people in some form or another. Maybe the dog is getting into their garbage to eat something and the person comes out hollering and chasing them off. Maybe the person sees their hungry and feeds them. These would be completely different experiences that would affect the dogs behavior toward people and how it felt about their interactions with them. Thousands of these interactions make up the dogs (or any animals) reaction to any given situation.