California passed a law that lets
you rescue dogs from hot cars. The
‘Right to Rescue Act’ requires passersby
to notify police if a dog is in danger- but,
if the threat is immediate, you can break
into a car to rescue the dog without fear
of punishment– as long as you stick
around to give the police a statement. Source
This law exists in most states for children too, and the dog version is probably going to spread or will be covered under the existing law for children.