The answer is in the words of Thor himself:
"Oh, no! Thor's in a cage.
How did this happen?"
Well, sometimes you have to get captured
just to get a straight answer
out of somebody. - Source
He is having visions of Asgard's destruction :
Because I've been having these terrible dreams of late.
Asgard up in flames, falling to ruins.
And you, Surtur, are at the center of all of
them. Then you have seen Ragnarok, the fall of Asgard.
- The great prophecy...
So, as he says, he was there to get his answers and to cancel the upcoming destruction of Asgard. He made it easy to become a prisoner of Surtur on purpose to get his answers.
So he tricks Surtur into telling how Ragnarok can happen and he just gets out of the chains to stop it.
It's a different issue that Ragnarok still happen and Thor made it happen.