Whether he escaped the devil depends on what you consider the devil to be. The eNotes introduction to the story states
At the end of the story, it is not clear whether Brown's experience was nightmare or reality, but the results are nonetheless the same. Brown is unable to forgive the possibility of evil in his loved ones and as a result spends the rest of his life in desperate loneliness and gloom.
To me, that would be hell. He can't see anything good in anybody, seeing "sinners and blasphemers everywhere he looked."
Hawthorne's ancestor John was a judge in the Salem witch trials, and Hawthorne seems to try to atone for his relative's crimes in his writings. I'm not sure we can say what Hawthorne's own beliefs were; he seemed to be trying to work them out for himself.
Discuss some of the appearance and reality in the story of Goodman Brown. Would you agree the whole story is based on illusions or more on appearance and reality?