Some think that Samson was a type of Messiah because he was a Nazarite (one consecrated to God - נָזִר nazir) for his entire life.
Behold, you shall conceive and bear a son. So then drink no wine or strong drink, and eat nothing unclean, for the child shall be a Nazirite to God from the womb to the day of his death.’ (Judges 13:7, ESV)
But this is not the only prophetical book that ties into the Nazarite theme of Messiah. The same Hebrew word 'nazir' is used (set apart) in reference to Joseph who was also a type of Messiah.
The blessings of your father
are mighty beyond the blessings of my parents,
up to the bounties of the everlasting hills.
May they be on the head of Joseph,
and on the brow of him who was set apart (נָזִר nazir) from his brothers. (Genesis 49:26, ESV - brackets original Hebrew)
Therefore by both Judges and Genesis playing on the theme of 'nazir' it can be said the prophets predicted that Messiah would be called a Nazarite.
According to Alfred Edersheim there is even an ancient Jewish tradition that seems to recognize this Messianic expectation of nazir:
ancient Jewish tradition, in referring to the blessing spoken to Dan (Gen. xlix. 17, 18), applies this addition: “I have waited for Thy salvation, Jehovah,” through Samson the Danite, to the Messiah. (Alfred Edresheim, Bible History Old Testament)
This view also seems to have been held by John Calvin, here.