Samson was a Nazirite, (Judges 13:1-5) yet we read that he touched dead persons ,Judges 15:8 , Why?
Nazirite: Meaning , "The one separated or one consecrated to God.
There were two types of Nazirites, those that volunteered and took the nazirite oath and those that were appointed by God.
Those that took the nazirite oath to God were to live as nazirites for the duration of the vow which was:
Numbers 6:1-7 (NRSV)
The Nazirites : Those that took the vow.
1" The Lord spoke to Moses, saying: 2 Speak to the Israelites and say
to them: When either men or women make a special vow, the vow of a
nazirite,[a] to separate themselves to the Lord, 3 they shall separate
themselves from wine and strong drink; they shall drink no wine
vinegar or other vinegar, and shall not drink any grape juice or eat
grapes, fresh or dried. 4 All their days as nazirites[b] they shall
eat nothing that is produced by the grapevine, not even the seeds or
the skins."
5 "All the days of their nazirite vow no razor shall come upon the
head; until the time is completed for which they separate themselves
to the Lord, they shall be holy; they shall let the locks of the head
grow long.6 All the days that they separate themselves to the Lord
they shall not go near a corpse. 7 Even if their father or mother,
brother or sister, should die, they may not defile themselves; because
their consecration to God is upon the head."
Nazirites: Those commission from from conception by God, did not take the oath and remained nazirites for life, their special purpose and requirements were defined by God;
Regarding Samson:
Judges 13:5 (NRSV)
5 "For you shall conceive and bear a son. No razor is to come on his
head, for the boy shall be a nazirite to God from birth. It is he who
shall begin to deliver Israel from the hand of the Philistines.”
Regarding John the Baptizer;
John was commission to turn the hearts of the people to God, and to make ready for the Lord a people prepared for him.
Luke 1:7-17 New Revised Standard Version (NRSV)
7 "But they had no children, because Elizabeth was barren, and both
were getting on in years.8 Once when he was serving as priest before
God and his section was on duty, 9 he was chosen by lot, according to
the custom of the priesthood, to enter the sanctuary of the Lord and
offer incense. 10 Now at the time of the incense offering, the whole
assembly of the people was praying outside."
11 "Then there appeared to him an angel of the Lord, standing at the
right side of the altar of incense. 12 When Zechariah saw him, he was
terrified; and fear overwhelmed him. 13 But the angel said to him, “Do
not be afraid, Zechariah, for your prayer has been heard. Your wife
Elizabeth will bear you a son, and you will name him John. 14 You will
have joy and gladness, and many will rejoice at his birth."
15 "For he will be great in the sight of the Lord. He must never drink
wine or strong drink; even before his birth he will be filled with the
Holy Spirit. 16 He will turn many of the people of Israel to the Lord
their God. 17 With the spirit and power of Elijah he will go before
him, to turn the hearts of parents to their children, and the
disobedient to the wisdom of the righteous, to make ready a people
prepared for the Lord.”