In the saltwater aquarium you don't have plant roots. Denitrification occurs in the live rock and the sand bed if it's not stirred and deep enough to have anaerobic areas. Some of the bacteria in the biofilm are optional denitrifiers in the absence of oxygen.
This also applies to freshwater aquariums. What happens is the plants can alter the substrate to extract nutrients from it with their roots.
As long as the substrate has nutrients in it, it will help plants and roots will grow. If the sand is inert and has a low granularity it will promote growth of anaerobic microorganisms and reactions resulting in all kinds of nasties to form in there. Gases like methane and hydrogen sulfide which are highly toxic will result from these anaerobic reactions.