In fact you don't need an aprotic solvent for this reaction. It's not the aprotic nature what makes DMSO and DMF very good for it (and for every Sn2 reaction with an anionic species acting as the nucleophyle).
Both DMSO and DMF have in common that
1. they are polar
2. the partial charges are distributed in such a way that the positive charge (C in DMF or S in DMSO) is not exposed for interacting with other molecules (it's in the center) and the negative charges (O and N in DMF or O in DMSO) is exposed (they're at the outside)
For these reason, these solvents are capable of coordinating the cation in the ionic species (Na+ in NaNO2) leaving the anion (NO2-) less hindered for the nucleophylic attack.
PS: I've attached a drawing wich I hope will help to understand what I'm trying to explain. Does anybody know how to insert images in the text?