NO2 group in ortho nitro phenol is an electron withdrawing group. It withdraws the electron from the benzene ring by both inductive and resonance effect. It forms the formalin of phenoxide ion resulting an increase in acidic strength.
On the other hand –OCH3 group is an electron donating group. It donates the electrons to the benzene ring and intensifies the negative charge of phenoxide ion. It do not favour the formation of phenoxide ion resulting indecrease in acid strength.