Whether or not you should be "allowed" to? I didn't realize I woke up in soviet russia this morning. >_>
Obviously common sense would be to do whatever it takes from keeping your pet from overheating, such as not leaving it in a hot car for longer than something like running into the gas station. Someone who would bring their dog along with them probably cares about it, if you were the cause of your pet dying don't you think you'd feel bad enough? The answer isn't for someone to be thrown in a cage or pay extortion money to the government because you're uncomfortable with the possibility of harm coming to a dog.
Besides, how could they prove how long that the dog was left there without subpoenaing the store's surveillance files? What if you went inside to buy a pack of cigarettes and you walk out and some retard vigilante is smashing open your window because you've "committed a crime." What if the dog just drops dead because of whatever unknown medical condition it has and someone noticed it? Should there be an autopsy? I'm sure you can see where I'm getting at with this.
No one wants to think about their pet dying. The solution would be a non-profit like a shelter running radio ads during the summer for awareness, local commercials, flyers, chewing out the guy who comes back with his dog in the car, etc.