In a titration HCl and NaOH have a 1:1 ratio. Can you still use the formula M1V1 = M2V2 to find the molarity of the NaOH base if we change the acid to sulfuric H2SO4?

No. H2SO4 doesn't have a 1:1 ratio with NaOH.

2NaOH + H2SO4 ==> Na2SO4 + 2H2O.