First, God Himself provided the rules by which a Nazarite vow should be fulfilled.
1 And the LORD spake unto Moses, saying, 2 Speak unto the children of Israel, and say unto them, When either man or woman shall separate themselves to vow a vow of a Nazarite, to separate themselves unto the LORD: 3 He shall separate himself from wine and strong drink, and shall drink no vinegar of wine, or vinegar of strong drink, neither shall he drink any liquor of grapes, nor eat moist grapes, or dried. 4 All the days of his separation shall he eat nothing that is made of the vine tree, from the kernels even to the husk. 5 All the days of the vow of his separation there shall no razor come upon his head: until the days be fulfilled, in the which he separateth himself unto the LORD, he shall be holy, and shall let the locks of the hair of his head grow. 6 All the days that he separateth himself unto the LORD he shall come at no dead body. 7 He shall not make himself unclean for his father, or for his mother, for his brother, or for his sister, when they die: because the consecration of his God is upon his head. 8 All the days of his separation he is holy unto the LORD. 9 And if any man die very suddenly by him, and he hath defiled the head of his consecration; then he shall shave his head in the day of his cleansing, on the seventh day shall he shave it. 10 And on the eighth day he shall bring two turtles, or two young pigeons, to the priest, to the door of the tabernacle of the congregation: 11 And the priest shall offer the one for a sin offering, and the other for a burnt offering, and make an atonement for him, for that he sinned by the dead, and shall hallow his head that same day. 12 And he shall consecrate unto the LORD the days of his separation, and shall bring a lamb of the first year for a trespass offering: but the days that were before shall be lost, because his separation was defiled. . . . . 18 And the Nazarite shall shave the head of his separation at the door of the tabernacle of the congregation, and shall take the hair of the head of his separation, and put it in the fire which is under the sacrifice of the peace offerings. 19 And the priest shall take the sodden shoulder of the ram, and one unleavened cake out of the basket, and one unleavened wafer, and shall put them upon the hands of the Nazarite, after the hair of his separation is shaven: 20 And the priest shall wave them for a wave offering before the LORD: this is holy for the priest, with the wave breast and heave shoulder: and after that the Nazarite may drink wine. 21 This is the law of the Nazarite who hath vowed, and of his offering unto the LORD for his separation, beside that that his hand shall get: according to the vow which he vowed, so he must do after the law of his separation. (Numbers 6:1-21, KJV)
As those rules plainly state, a Nazarite was not to shave his or her head, but if someone died by him or her, then he or she must shave it (and no longer be counted a Nazarite while it was shaven).
Apparent contradiction #1
Ye are the children of the LORD your God: ye shall not cut yourselves, nor make any baldness between your eyes for the dead. (Deuteronomy 14:1, KJV)
God's people were not supposed to make themselves bald when someone died.
Apparent contradiction #2
Samson, a Nazarite, killed many people, without losing God's blessing and strength until he had his hair shaved--then lost both.
And Samson said, With the jawbone of an ass, heaps upon heaps, with the jaw of an ass have I slain a thousand men. (Judges 15:16, KJV)
After slaying all those men, he went into the city where they tried to lock him in at night. Yet, via superhuman strength, he easily escaped.
And Samson lay till midnight, and arose at midnight, and took the doors of the gate of the city, and the two posts, and went away with them, bar and all, and put them upon his shoulders, and carried them up to the top of an hill that is before Hebron. (Judges 16:3, KJV)
It was after this that Delilah famously enticed his secret from him...and cut his hair.
That he told her all his heart, and said unto her, There hath not come a razor upon mine head; for I have been a Nazarite unto God from my mother's womb: if I be shaven, then my strength will go from me, and I shall become weak, and be like any other man. (Judges 16:17, KJV)
19 And she made him sleep upon her knees; and she called for a man, and she caused him to shave off the seven locks of his head; and she began to afflict him, and his strength went from him. 20 And she said, The Philistines be upon thee, Samson. And he awoke out of his sleep, and said, I will go out as at other times before, and shake myself. And he wist not that the LORD was departed from him. (Judges 16:19-20, KJV)
In brief, the two contradictions might be summed up in two questions:
Why would God say that the Israelites were His people and should not make themselves bald when someone died, and then command that the Nazarite head be shaven for a death?
If a Nazarite was supposed to cut his or her hair if someone died next to him or her, then why was Samson blessed when he did not do this, and cursed when he did?
Any Biblical insights that will help to erase these apparent contradictions are appreciated.