Yes, but petrol for cars was mainly rationed to divert huge quantities to the military, the RAF, and to army lorries which were at this time almost wholly petrol, not diesel - in part because the supply chain for diesel was limited then, but for petrol much more established, particularly as they overran various other countries which were all petrol. There was a great benefit in sticking with one fuel for everything.
Steam locomotives running on oil were well established in the USA by the 1930s, particularly in places like California or Texas which were well away from any coal mines, and were almost wholly oil - they had gone straight from wood to oil firing there. The pipework required is relatively straightforward to manufacture and install, without high-tech components. The locos of some companies like the Santa Fe were converted back and forth as they moved around the system. Refinery techniques were not as developed then as now, there was a considerable residual product from the crude, for which burning in steam locos (and ships' boilers etc) was fine. Of course, the many UK loco manufacturing businesses of the era were also very familiar with oil firing components, as they built export locos for those overseas countries and colonies where there was no coal supply.