The law states: 1. Only a local authority Inspector or a Constable have a power to enter a "premises" for the purpose of assisting an animal that is, or is likely to be, suffering. This is governed under Sections 18 and 19 of the Animal Welfare Act 2006.
Sec 62(1) AWA 2006 defines "any vehicle" as a "premises".
2. Any member of the public who breaks into a vehicle to assist a suffering dog would not be protected by the powers under the AWA 2006, and would no doubt be subject of an investigation for an offence of Criminal Damage. However, Sec 5(2)(b) Criminal Damage Act 1971, does offer a defence to their actions in that (i) property was in immediate need of protection, and (ii) that the means of protection were reasonable.
For their actions to be reasonable there must be a level of implied consent. For example, "I broke the lock off the water bowser to put out the burning shed." It would be reasonable to assume an implied consent from the owner that they would wish the person to damage a £5 lock to save a £500 shed and it's contents.
It might be argued that it would be reasonable for a person to believe that there was an implied consent from the owner of the car for them to break a car window to save their dog.
The big word here is "reasonable". If a person just breaks a window as there is a dog inside, and the dog is obviously fit and well, then their actions might well be deemed unreasonable, and they would have committed an offence.