Humans have bred some dogs to naturally be more territorial. Guarding breeds often will start to bark at strangers near their home at about 9-10 months of age. Territorial displays differ from fear aggression. We can control this behavior by understanding each breed type and seeing that our training is designed to put those instincts and behaviors under control. It’s important to understand we do not “fix” normal, but we can have a guarding breed with guarding tendencies that is not reactive/aggressive.
A dog can be both territorial and fear aggressive so it’s important to get fear under control. If a dog’s behavior is strictly territorial (vs fear, over-arousal, etc.) the behavior can provide clues about their relationship with their owners or the people they live with. A dog needs to realize that they are not responsible for the humans and the territory, but rather they are responsible to the humans. A dog that realizes they are responsible to the humans does not believe the environment allows them the liberty to act as they please. Dogs should feel responsible to us, not for us and should accept visitors into the home as long it is clear they are invited guests. I’m sure it goes without saying, but you need to act calm and under control (not concerned) around people your dog does not trust. You don’t need to establish an authoritarian relationship to be considered the one responsible for the territory, you just need to lead.
The 60 page book "Finding A Balance" by Suzanne Clothier is a great place to start.