I would definitely call the police, first. They can instruct you to break the window if the animal is in severe distress. But if the dog appears comfortable, they’d want you to wait until they arrive. Animal control would be the one to take the animal anyway. You can’t just break someone’s window and take their dog, even if they’re ignorant.
Or, go into the establishment the car is parked in front of and request an announcement be made for the vehicle owner to help their pet.