It depends on how much organic matter is in your substrate and how compact the substrate gets. Decaying peat can be dangerous, too much unremoved leaf litter can be dangerous, and if you use fine granular sand, it will compact very easily becoming dangerous. Using garden soil, top soil, which may contain manure, leaf compost, worm castings, and other sources of high nitrogen can be dangerous for this reason.
Several years ago I used peat plates in my substrate, the kind you buy in pet stores. Within 8 months the peat turned jet black and was rotted. I had little bubbles of toxic gas coming up from the substrate. It smelled very foul, like rotten eggs. Plants in that area began to melt, and when I pulled them up the roots had turned black.
You can often get pockets of anerobic while the rest of the substrate remains fine. This is actually fairly normal. People say you can avoid this by churning up the gravel to prevent it from compacting, or by doing deep vacuming. Problem is that when you disturb the substrate, you unearth mulm and nasties into the water which can cloud the water, raise DOC, and bring out pollutants into the water. If you vacum you can remove fertilizers and additives such as laterite.
The best thing is to avoid using organic material in the substrate, do regular water changes and surface vacuming, and remove dead or damaged leaves from plants before they disintergrate into the substrate.
Some plants seem to actually do well in a anerobic substrate. Some Cryps.
Ghazanfar is obviously not growing large swords, Crinums, or Nymphae! These are deep rooting plants with massive root systems. With large plants, you need a deeper substrate just to keep the plants down! 5 or 6 inches is the max I have ever used.
Bear in mind too that in a healthly heavily planted tank, the roots themselves give off oxygen. Only when the substrate becomes root bound and overloaded with organics does it become a problem. With very mature tanks, 5, 8, 10 years old, a shallow substrate can become one big root ball.