With some modification a diesel engine can be ran on vegetable oil. However some problems with viscosity will occur in colder climates (the oil is too thick at low temperatures). Keep in mind the creator of the diesel engine, Rudolf Diesel, designed his engine to run on peanut oil, and this was back in 1900. The idea was that a vegetable oil was cheaper than petroleum.
A gasoline powered engine cannot readily be adapted to run on vegetable oil. Interestingly, a gas engine can run on the combustion air from a wood fire (wood smoke). But this is something altogether different, and much more involved.