There isnt anything by RAW that would be sufficient use to your players.
I could not find anything that would readily allow duplication of gasoline, though there was 1 thing I could find that your players might be able to use, an Alchemy Jug.
This item can produce a set quantity of a list of liquids once per day. Amongst this list is 'Oil'. Given how indistinct this is, your players could possibly produce said oil and then refine it into gasoline, but there is a hitch, only 1 quart can be produced per day. At most, you get 3/4ths as much gasoline as you had in oil, so you could get as much as 1.5 pints of gasoline from 1 quart of oil.
The big problem with this is that no reasonably leveled spell would allow you to refine the oil by magic, so you would have to use conventional hardware to do so, even if you could use magic to produce the energy input for said hardware.
As for spells, your players would have two options.
First, they could use Wish, but since creating a mass of liquid is not among the standard options, there is a 1/3rd chance of losing Wish, plus the inherent danger of unforeseen effects, meaning that better choices are present if using this spell.
Second, they could forgo the gasoline, and use Animate Objects, but that requires a 5th level slot, concentration, and only works for a minute at a time.
Upon first glance, it may look like even the spell Fabricate is viable, but there is a hitch
You convert raw materials into products of the same material. For
example, you can fabricate a wooden bridge from a clump of trees, a
rope from a patch of hemp, and clothes from flax or wool.
can't use it to create items that ordinarily require a high degree of
craftsmanship, such as jewelry, weapons, glass, or armor, unless you
have proficiency with the type of artisan's tools used to craft such
It is debatable whether oil being refined would count as it being the same material (personally I think it is close enough). But, refining is a high craftsmanship process, which means whoever uses the spell would need to have done refining personally prior to using the spell. Plus, the volume of gasoline they could produce would still follow the normal refining ratio, and be limited by the amount of oil they could access. However, 'crude' oil (which is used to produce gasoline among other things) does flow from the ground in some places, and was used in some lamps during medieval times, so with some prospecting (and lucky rolls), someone could find a plentiful supply.
Your players do have 1 chance though, YOU. You could decide that an Alchemy Jug can produce gasoline itself, or allow a reflavored item to produce it (such as the Decanter of Endless Water). Assuming you want them to make much use of the car that is.
As to replicating a 'modern' car, the difference in knowledge and technology is just far too great. But, the basic mechanics of a car could be replicated, notably, by steam power. All that is needed, is a source of energy, and a driving system for the wheels. Given the likelyhood of waterwheels or graineries existing, and of teapots existing, a car can be produced.
Off the top of my head, it would need to be a wagon or carriage, with a ready supply of water (could be Decanter of Endless Water), and a source of ready high heat. As for supplying that heat, I could not find any items or spells to safely and reliably produce a useful flame for a steam car, but if you have a fuel source (such as oil), and someone with Prestidigitation or Druidcraft (or other cantrips that allow ignition of flammable material), then you have everything you need. (and you dont even need to break raw)