The Rishonim learn that the one who gives the nazir a haircut has violated this prohibition.
The Haflaah asks: How do we know from this verse that the one who gives the haircut has violated this prohibition? Perhaps it is the nazir who is transgressing by allowing the other fellow to give him a haircut, but the “barber” has not violated anything!
Hair that will be cut off is still not a Chatzitzah
The Gemora (Daf Yomi: Nazir 44b) cites a braisa: If he cuts his hair on the eighth day, he brings his korbanos on the ninth day.
Rava explains that the braisa is talking about a case where he did not go the mikvah on the seventh day.
It is evident from this Gemora that the immersion of a nazir is valid, even though it occurred prior to his haircut! One might argue that his hair should be regarded as a chatzitzah (interposition), since it will shortly be cut off.
The Chasam Sofer (Y”D 195) derives from here the following halacha: Although a bride will be shaving her hair immediately after she marries (for her head will be covered), nevertheless her hair is not regarded as a chatzitzah when she immerses in the mikvah before her marriage.