Samsung is a very wealthy company, more so than almost any firm. The mobile division could survive anything that Samsung sees fit to pay for.
The exploding battery was very unfortunate and Samsung knows now exactly why it happened. I’m sure a great many people lost their jobs over it and there is great pressure to produce a winner with the S8 and build back both Samsung’s reputation and some revenue.
To specifically answer your question – yes.
It wouldn’t be great, but also bear in mind that Samsung sells a LOT of phones and most of them aren’t high-end devices like the S8. It could exit high-end entirely and probably still be in the best position globally for phone sales.