If you use the high value resistor, it will limit the current flow into A0, and the diodes that protect the pins should clamp the level to Vcc (5V in this case). When A0 sees more 5V, it will always return 1023. Is that what you are expecting?
If you want actual measurements, than use a 2nd resistor so that A0 sees 5V when 12V is applied. Adding 1M from A0 to Gnd will result in:
Vout = Vin * R2/(R1 +R2)
= 12V * 1,000,000 x (1,500,000 + 1,000,000) = 4.8V.
If you are using this in a real vehicle, keep in mind that 12V on a battery will be higher when the car is running as the alternator output is higher (like 14.2V), to charge the battery (and a fully charged battery might measure over 13V), and there can be nasty spikes from other circuits also, so some additional protections might be needed at the A0 pin.