Unfortunately for a fire extinguisher to be any use it would be too large to carry in a car. Halon seemed to be the answer but they are no longer used because of damage to the ozone layer.
Your average car type fire extinguisher will last 5 to 10 seconds and may be useful in the event of an electrical fire but when it come to petrol it is not likely to last long enough to extingish the flames.
Dry powder extinguishers are not ideal to be carried in the car as the vibration compacts the powder making it useless. It would seem CO2 or foam would be the correct type but their size makes them difficult to fit in our cars.
Perhaps someone will report their actual use in an incident and whether they were effective, or not.