Both Neville and the Sorting hat appear to have been protected by the "aura of love" cast over them by Harry Potter.
Although they're both engulfed in Voldemort's magical flames, there seems to be little or no consequence of this and the flames themselves seem to disappear as soon as Voldemort is distracted. I've edited for brevity and clarity:
‘Neville here is now going to demonstrate what happens to anyone
foolish enough to continue to oppose me,’ said Voldemort, and with a
flick of his wand, he caused the Sorting Hat to burst into flames.
Screams split the dawn, and Neville was aflame, rooted to the spot,
unable to move, and Harry could not bear it: he must act –
In one swift, fluid motion Neville broke free of the Body-Bind Curse
upon him; the flaming Hat fell off him and he drew from its depths
something silver, with a glittering, rubied handle –
"Harry Potter and the Deathly Hallows"
Later, Harry explains to Voldemort why his spells aren't working very well...
‘– I meant to, and that’s what did it. I’ve done what my mother did.
They’re protected from you. Haven’t you noticed how none of the spells
you put on them are binding? You can’t torture them. You can’t touch
them. You don’t learn from your mistakes, Riddle, do you?’
"Harry Potter and the Deathly Hallows"
Even if there was any burn damage after the magical flames die down, I presume that fixing the hat afterwards would be trivially easy using a "mending charm" or some similar magic spell.
As to the ultimate fate of the hat, as @alexwlchan notes, Harry Potter indicates that they still use a sorting hat in 2017. His dialogue strongly suggests that it's the same hat that sorted him into Gryffindor:
”The Sorting Hat takes your choice into account.”
“Really?”
“It did for me,” said Harry.
"Harry Potter and the Deathly Hallows"