Samson must have thought he was invincible. There is no evidence he kept any of the Nazarite vows (see Numbers 6:1-21), other than not cutting his hair, and he even dishonoured that eventually.
Having spent time drinking, eating honey from a dead lion, killing people in personal revenge, and marrying a Philistine woman, it isn’t unreasonable for Samson to have believed he would keep his strength forever (and that God wanted him to use it): it could well have looked like case of ‘all rights and no responsibility’.
When he finally told Delilah about his hair being the source of his strength, it seems that Samson didn’t really believe it, thinking that after she cut his hair:
Judges 16:21 When he woke up, he thought, ‘I will do as before and shake myself free.’ But he didn’t realise the Lord had left him.
It was possibly less a case of the hair itself being important than of God finally having had enough and withdrawing His blessing. There wasn’t a single vow left for Samson to break, and therefore, nothing left for God to honour.
James Bond fans might imagine something like this: