What an irresponsible and dangerous thing to do. People are eejits. Assuming I understand correctly that the owner and car were on the road and the dog was running alongside on the sidewalk.
Most dogs will chase the car their owner is driving with little encouragement needed. So many things can go wrong. Running on concrete sidewalks is hard on joints. The dog went onto the road, lucky another car didn't hit it, if not in this scenario then in another. The dog could run off, knock a person walking over, attract unwanted attention from another dog, be reported for being off leash.
Someone regularly does this in a bush we walk in. The lazy #@$$%%%!! drives through one side and out the other with the dog running full tilt behind their car. At least the ground here is kinder to dog joints but one day they are going to encounter another of our regular eejits, the people who ORV at high speed through that same bush.