Hello Gordon,
I do sometimes charge a spare battery in the boot of my car, and just as Damain says its is secured and vented.
Just in case you are not aware, there are some other essential safety precautions.
You say you have a 12v Socket in the boot of your car. Do not use it if it is a cigarette lighter type. They are very unreliable at maintaining a good electrical contact, and under sustained heavy currents (such as charging a battery) they can melt.
I use a specially made up lead that plugs into the 12S socket and the cable passes through the soft seal of my boot lid. This uses the normal charging circuit for the caravan and ensures the battery is only charged when the engine is running, and it will not try to discharge the battery when trying to start the car.
Both the positive and the negative leads are fused (10A).