Dogs are usually very protective of their space in a car. It’s not something you did. They’re in a small, confined space. Their space. And a stranger walking by is considered a violation of it to some dogs.
That dog may have been aggressive but he clearly did not want to bite you, otherwise he would have jumped out of the car and given chase. Seen it done… Then watched the dog jump back in his car.
People can be incredibly careless with dogs in a car.
One year we had three dogs in the back of my Honda civic It was a breezy day for September and we visited a dog-friendly beach, tired out our canine companions with a romp on the strand then elected to grab a bite to eat. We parked on the boardwalk where a restaurant was and sat on the porch on the boardwalk right in front of our car. The car was literally 5 feet away, and we were on the deck supervising them. It was cool out and car was in shade, (~60 degrees) and all windows and the moon roof were open.
We watched multiple people pass by our dogs and they each ignored each other. No problem.
Then we watched a gaggle of teenagers approach the car and our eldest dog said “hark! an intruder approacheth!” - ears swept forward, curly tail a-wagging, all smiles as the teens approached. Our eldest was more inclined to mob you for a cookie than mob you for trespass. We watched, slightly bemused by seeing three dogs looking not unlike Cerberus, pulling their heads through the window @ the teens with inquisitive noses and bright eyes…
But our amusement was short lived as one teen decided to reach into the car to pet the furthest dog, who objected quite clearly to the intrusion. This is the one with the rabid-ole-yeller bay - I never saw a hand retracted so swiftly in my life. What stranger in their right mind places their body part in a strange vehicle with a strange group of dogs?
But anyway, I find if you ignore them and obviously don’t put your hands in their car, they’ll just likely bark and yell at you until you’re off.
FWIW some people have no idea the dog’s behavior in a car… I have had a dog who was the laziest and sweetest thing ever who could give you a murderous stare and stiff upper lip snarl if you walked within 5 feet of his vehicle… and by contrast, my resource-guarding little shithead dog is the biggest beggar for attention in a car… So you never know what your dog’s behavior is to strangers in a car regardless of their behavior outside of it - I find the two are very, very different.