https://www.animallaw.info/topic/table-state-laws-protect-animals-left-parked-vehicles
States with such laws typically allow rescue of the animal from the vehicle. This may involve forcibly entering the motor vehicle to remove the trapped animal. Some states limit their "rescue" laws to law enforcement, firefighters, animal control, first responders, or authorized humane officers. Recently, about 15 states have enacted laws that allow any person to rescue a distressed animal (AZ, CA, CO, CT, DE, FL, IN, KS, LA, MA, OH, OR, TN, VT, and WI). These laws functions to limit the civil or criminal liability of the person for damages resulting from the forcible entry of the vehicle.
Actually, 31 states have laws that either prohibit leaving an animal in confined vehicle under dangerous conditions or provide civil immunity (protection from being sued) for a person who rescues a distressed animal from a vehicle.