Mg produces hydrogen with dilute #HNO_3# but Zn does not do so. What is the explanation of this phenomenon?
Are you sure that the premises of your question are correct?
Zinc is one of the more active metals that will react with dilute nitric acid. With conc. nitric, nitrogen oxides can be formed. Look in your text for tables of redox potentials.