A lot of literature based on this theme is very close to utopian/dystopian literature: tales of utopian islands hospitable to castaways, people locked up in such horrifying circumstances that their world shrinks to dystopia. Here’s a reading list:
THE ODYSSEY–the ultimate castaway tale
Shakespeare, THE TEMPEST–the magical isle that at least one castaway envisions as Utopia
Defoe, ROBINSON CRUSOE–or is THIS the ultimate castaway tale?
Various CAPTIVITY NARRATIVES from the Americas–with various attitudes/perspectives from captors and captives
Levi, SURVIVAL IN AUSCHWITZ–is the concentration camp the ultimate dystopia?
Atwood, ORYX AND CRAKE–what if the whole destroyed world is your prison? (and to follow it up, try the sequel, The Year of the Flood)