Yes if the situation was dire and there was no obvious way to find the owners quickly like an intercom in a shop they'd parked outside.
I'd first call the police, then the RSPCA, listen to what they say about breaking people's property, but break in anyway after a few minutes
* it isn't the fresh air the dogs need so much as being removed from a situation in which they are being cooked by a metal and glass solar oven. The point of heatstroke is quickly reached and malignant hyperthermia takes over. Even if you get them out they can suffer disastrous long-term effects from Rhabdomyolyis (where the body breaks down muscle tissue which ruins the kidneys, which are organs that cannot self-repair.) Just don't leave a dog in a car in the UK between the end of April and the end of September. Opened windows help only a bit, parking in the shade still heats the car up. A locked large crate with water, inside a fully open tailgate in a big estate car parked in reliable shade and open to the breeze, is the only temporary solution that works. That's why you often see them being used on the show circuit, and even then the owners are close-by.