You haven't committed an offence pur'say but it is very irresponsible as a dog owner.
Even if its a cold day you should open the windows of your car to allow fresh air to enter the car for a dog, remember that dogs don't have sweat glands, so they literally boil to death.
Like you have said...