Aggression issues occur for different reasons. No matter the reason, it is not a behavior that can be tolerated for the safety of not only your pet but the people they live with and meet.
Always practice fair leadership with your dog; they must earn their rewards.
Don’t give affection when your dog acts afraid. Instead redirect their focus i.e. have them do a trick.
Give unknown dogs space until they decide to sniff and greet you in a friendly way.
Give plenty of constructive physical and mental exercise.
Use obedience class as a great way to condition your dog.
Remember YOU are the your dog’s pack leader.