Margins are ratios of revenue
Each of the three margins divides a profit figure by total revenue, never by cost. Gross margin is revenue minus cost of goods sold, divided by revenue; operating margin further subtracts selling and administrative expenses; net margin subtracts everything remaining, including interest and taxes. With the denominator fixed, the results always fall in order: net margin cannot exceed operating margin, which cannot exceed gross margin.