On a car, you're going to have voltages varying from 10 to 14 volts, depending on what you do with the car. When you start the car for example, the process will "stress" the battery and the voltage will drop down quite a lot under 12 volts. When the alternator charges the battery, the voltage provided can be around 13-14v.
A 7812 is a linear regulator, and linear regulators need to have the input voltage above the output voltage by some amount. In the case of 7812, that value is about 1.5-2 volts. There is no exact value, it varies with how much current your device uses, how hot (or cold) the linear regulator is, and how well the linear regulator was actually produced.
So a 7812 is not a good solution for your problem. In fact, a linear regulator is not really a good solution.
Ideally, you would use a SEPIC regulator ( a regulator that can reduce or increase the incoming voltage to a particular output voltage) but I guess that's a bit over your head.
Alternatively, you could use a linear regulator like 7809 or 1117 (adjustable to output 9v) to reduce the voltage to something like 9v for example, and then use another boost regulator to raise that 9v to exactly 12v. You can find such ready made boost regulators on eBay.