Soil can obviously be used, though I question whether it is really worth the trouble.
If you do, make sure you research the issue well; most authorities suggest setting up a soil substrate tank and leaving it for 6 months before any fish are added. This I gather is to allow the biological system to properly establish itself. Not doing something like this can cause sudden rises in ammonia which will kill fish and plants. There will be fluctuations during the first six months; Diana Walstad even admits this [she is the major proponent of soil substrate tanks].
The problem with using commercial terrestrial plant soils is getting nutrients in the tank that you do not need, or that can cause trouble. Plain pure clean soil is suitable, but it should not contain any fertilizers. The prime idea behind soil is releasing CO2, not trace element nutrients. Walstad writes that the best results are obtained with unfertilized potting soils. Soils containing any fertilizers have nitrates that when submerged in water quickly convert to toxic nitrite; sulfates will convert to hydrogen sulfide that will kill plant roots and bottom fish.
Anaerobic conditions can occur much faster, as someone mentioned. This pulls a lot of oxygen out of the water, especially during the first 8 weeks, causing an oxygen shortage if fish are in the tank. During the first few weeks, the soil will flood the water with nutrients, causing an algae increase. Plants have to be growing well before all this "chaos" begins. [The info in these two paragraphs is taken direct from Walstad.]
Also note that Walstad limits the number of fish in such tanks. I could never have a planted tank with as few fish as she advocates; I like the fish too much.