The question is incorrect, nitration of methylbenzoate occurs at 3 position to get, methyl 3-nitrobenzoate.
This is because, in present reaction the reactant i.e. methylbenzoate, has low electron density at m-position.
Due to this, NO2+ prefentially attaches m-position to form methyl 3-nitro benzoate as the product.
A detailed reaction mechanism for formation of product is provided below.