Your dog is scared and acting aggressively to cope with what it finds difficult in his/her environment.
This type of dog behavior is more commonly known as fear aggression.
Fear Aggression in Dogs
When a dog is in the presence of something that it perceives as a threat and becomes fearful, it responds with a flight or fight mindset. Triggers can be dogs, people, moving objects etc.
If you have such a dog I understand everything you go through. The embarrassment, frustration, tears, anger AND the contemplation of giving up and rehoming your beloved dog. All is not lost and you can build a better life for your fearful dog and walk him or her without reactivity and fear.
Training an emotional change in a reactive dog can be done using techniques and tools that don’t harm the dog and it requires time, patience and perseverance on the guardians part. I use a "Do No Harm" approach to teach dogs how to cope with their fears.