It is because HNO3 is a strong oxidising agent. It oxidises the H2 produced to water and itself gets reduced to any of the nitrogen oxides (N2O, NO, NO2). But magnesium (Mg) and manganese (Mn) react with very dilute HNO3 to evolve H2 gas.