Generation of coherent terahertz radiation in 2D nitride-based structures