Can you legally break into a hot car to save a dog’s life?

Can you legally break into a hot car to save a dog’s life?