Most people may believe that oil comes from dead plants and animals, but there are alternative theories that are known as Abiogenic Petroleum Origin. If oil in generated in this manner it could mean we could find oil on other planets or moons as well.
As far as we can tell, almost all crude oil (petroleum) is biogenic, and specifically comes from marine organisms. That's the only theory that is supported by the geological record, by the thermodynamics, and by what we know of the biology and the chemistry.
That's not to exclude the possibility of abiogenic petroleum: indeed, we know that abiogenic liquid hydrocarbons are possible, because we can synthesise them ourselves. So finding hydrocarbons that cannot be biogenic does not show that most fossil fuels are abiogenic: it merely shows that some abiogenic hydrocarbons exist.
However, the quack theory, popular in Soviet Russia and with other fringe pseudo-scientists, is that almost all oil discovered in the ground comes from abiogenic sources. Geoff Glasby looked at how the pseudo-science came about, in his article Abiogenic Origin of Hydrocarbons: An Historical Overview (Resource Geology, vol. 56, no. 1, 85–98, 2006) DOI:10.1111/j.1751-3928.2006.tb00271.x
Dead macro-organisms, plants and animals, are not necessary to form oil. For example consider oil from the Pre-Cambrian siltstones of Oman, which formed long before the evolution of land animals or plants. On the other hand, EnergyNumbers is correct, that the hypothesis of abiogenic origin of oil, proposed by creationists, etc., is completely defunct. There is plenty of abiogenic hydrogen in the Earth, such as released through the process of serpentinization, but it takes more than hydrogen to make oil. In fact there are three requirements: kerogen, temperature and time. The kerogen comes in many forms, being derived mainly from marine and lacustrine microbiota, and also from higher land plants. A small fraction also comes from weathering of polycyclic aromatic hydrocarbons. These provide the complex polymers, in some ways similar to the tannin in your tea, from which the more complex oil molecules are formed. Oil is a complex cocktail of compounds, of which I would cite in particular the C27-C29 steranes as being indicative of the oil's age. It takes hundreds of millions of years under warm pressurized conditions for the 'C29' type of oil to evolve. I cannot envisage any conditions in which these compounds could evolve from simple methane-type precursors. That's not to say it is impossible (maybe my limited imagination?), but it's very improbable.
As for oil on other planets, without life, first define what you mean by 'oil'. Simple organics are widespread, both in the Solar System and beyond. More complex organics probably require life to evolve, especially in the cold conditions of moons in the outer Solar System. But who knows what exists in the hidden ocean beneath the icy surface of Europa? I would be surprised to find 'Earth-like' oils in this ocean, but the evolution of simpler oils in this environment would seem eminently plausible.
So far the science has reached the following conclusion (from this report):
“Extensive scientific research and practice have proven that a relatively large percentage of hydrocarbons, especially oil, are generated organically. However, this does not rule out the possibility that another large proportion of hydrocarbons, gas in particular, may be of abiogenic origin."
However, oil exploration on planets and moons is a way far reaching proposition.
Actual environmental scientist here. Crude oil and other similar "fossil fuels" are the result of organic materials held at intense pressures for millions of years. That is the only theory accepted by modern scientists outside of the Ukraine. There is no other theory, because no other hypothesis has been supported with the kind of evidence necessary to even consider mentioning it in conversation. Anything that says otherwise is pseudo-science.
Oil = organic materials