I’m not completely sure, there is actually some debate on whether or not Samson broke his vow since it seems his strength would have left him if he broke it. He did also use the donkey jawbone to kill the Philistines while the Spirit of God was on him. If these cases did break his vow then they seemed to be sanctioned by God. Perhaps Samson touching the unclean was to signify that Jesus could make the unclean clean?
Same thing for me.