In the short story, a man is swallowed by a giant, fictional fish. In fact, he is swallowed whole along with his log cabin and a bunch of hand-crafted tools. In a "The Martian"-like narrative, he miraculously survives as long as he can inside the body of the fish. My major concerns, before doing any research, are how realistically lethal are stomach biles and suffocation risks inside another creature's body? What other serious risks might I be missing? I'm using a whale as a real-world reference, but in the story it is a fictional species of fish--so creative adjustments can be made.
I'd give your character a minute at best.
Problem 1: oxygen
Contrary to depictions of Pinocchio, a creatures stomach is not filled with breathable air. The stomach contracts regularily in order to store the food in as little volume as possible. In fact, trapped air is regularily expelled as burps. Your character would survive as long as he could hold his breath.
Problem 2: swallowed debris
Let's assume the whale swallowed not only a man within his log cabin, but also a bubble of breathable air. The stomach contracts and moves in order to mix its content with stomach acid to aid digestion. That means, massive logs and other debries are constantly moved around, most likely crushing or otherwise injuring the man. At the very least they would hinder him from keeping his head in the air pocket.
Problem 3: Stomach acid and panic
Now let's assume the man was swallowed with a breathable air pocket but without debries. He would now swim in one of the strongest naturally occuring acids, in complete darkness. Realisticly he would have gotten the stuff into his eyes and probably lungs as well, causing coughing, burning pain in the eyes and panic. It's damn hard to tell up and down in complete darkness, causing more panic. If the creature is so big that he has to swim, he would swim in the slimy, viscous contents of a stomach which would tire him out quickly. Even if he keeps his eyes and airways free of the acid, he would start to feel burning pain all over his body really soon. Eventually either he gets some of the acid into his airways and suffocates, looses conciousness because of the pain or simply tires out and drowns in acid.
As other answers have explained, surviving within a whale or a fish is not plausible without either a new kind of fish or some expensive equipment. Since this person is presumably not a professional fishgut-diver, we need to focus on the qualities of a fictional fish that a human could plausibly survive inside.
He is not inside the stomach, but rather the swim bladder.
Many fish possess a swim bladder - a gas-filled organ that helps them balance out their weight and remain buoyant, making it easier for them to swim. Some fish - called phytosomes - have a direct connection between the stomach and the swim bladder, not entirely unlike how land animals have a connection between the stomach and the lungs. These fish are able to fill their swim bladders with air by swimming to the surface and "gulping" the air. Our fish explorer was not "swallowed" so much as inhaled, which is how they end up in the swim bladder instead of the less habitable stomach.
The details of gas in the swim bladder vary from one fish to the next. Some use their swim bladders for oxygen exchange, others will actually fill it with oxygen from their blood, though they don't usually keep it oxygenated to any particular level, it just happens to be the easiest gas they have available (your person may actually have a problem from too much oxygen). Some will store oxygen in it when they are in shallow water and then consume that oxygen later when they dive deeper. Many don't care about the particular gases in it at all since it's just ballast to them, they just fill it up from the atmosphere and leave it alone - this is probably your best bet for survival, since although the air is limited it is at least still atmospheric air.
Which particular kind of fish you are dealing with depends on how long you want the person to be able to survive, but it is (somewhat) plausible to come up with a giant fish that a person could live in for a fair amount of time.
If you want to get really interesting maybe this fish has an air-breathing symbiote living in its swim bladder; this would explain why the fish maintains a breathable atmosphere inside and also give your person something to interact with (or worry about).
This website is the most detailed scientific study of the Jonah account I've seen: https://bookofjonah2amaic.wordpress.com/2013/07/03/is-the-jonah-and-the-whale-account-scientifically-and-historically-plausible/
Condensing the article, the author seems to believe that the sperm whale is the most likely candidate of whale for the biblical account (considering size and the locations of internal organs), so that's what he's mostly referencing, though your fictional fish can obviously differ.
There's a section that discusses both stomach acid and oxygen. From what I read, the stomach acid wouldn't be pleasant, but also not too deadly depending on the whale (your fictional fish could have a low pH acid for slow digestion).
Growing up in church, we had a youth pastor suggest that the stomach acid could have turned Jonah's skin white (which gave him a lot more attention by the time he reached Ninevah to warn them of judgment). A number of articles suggest this could have happened to Jonah (and did happen to modern men), but some of the articles are referencing hoaxes or fictional accounts--so I'm not sure where the "bleached skin" idea originally came from. Still, it's worth considering.
As for oxygen, the article I linked to above says this:
"Macloskie (1942) argued that the whale has to expel superfluous water from its mouth after receiving food. In the process a creature trapped in the mouth might reach the laryngeal pouch below the larynx. The pouch is big enough to hold a human who would, in addition, use the whale’s own air supply and have no worries about digestive juices.
He also suggests the possibility of living in the sinus cavities of the whale.
I guess in conclusion, your fish really just needs to have a low pH for the stomach acids and access to the whale's lungs or air. You could have the stomach and the laryngeal pouch connected (like the fish in the article). Having a dude in your lungs probably isn't super healthy for the fish, though, and he'd probably vomit your character out eventually, or die.
Also got to consider if his entire cabin is also swallowed, the guy has to survive being crushed by debris from his house. Unless your fish is a really...big...fish... But hey, Pinocchio's dad did it.
The largest apex predator whale is the Orca, aka “the killer whale”. It's prey is fish, birds, seals, even other whales. I doubt it has the ability to swallow a man whole.
Larger whales such as a blue whale, the largest animal on earth, feed by sucking in large volume of water and filtering it through baleen, which acts like it's teeth. It then scrapes the food off the baleen with it's tongue and swallows it whole. But the food consumed is krill and small fish. It is really doubtful that a man could be swallowed whole.
Assuming that you could find a whale capable of swallowing a man whole, the answer becomes how long can you hold your breath?
What you're going to need to do is invent a new whale. Thankfully, you're posting in Worldbuilding where such a feat is possible.
Good luck and thanks for all the fish.
I am thinking of a fish like a catfish, that swallows stuff whole. Catfish also swallow rocks and then later spit them out - presumably behavior like that is why it got the whole log cabin.
I have wondered how animals that swallow stuff whole get away with it. Especially things like scorpions that can hold their breaths a long time. The answer is that a stomach is a bad place to be alive. Strong acid and enzymes, muscular action rubbing stuff around (and up against rocks), no air.
The log cabin is the hope for your guy. The logs will hopefully hold up against the grinding and rubbing, and won't immediately be eaten away by the acid. The cabin will hold enough air for him to survive a while. A fish (or anything else) that eats stuff that proves indigestible (like rocks, or log cabins) will eventually puke it back out.
There will not be much of a view out the window. It will be very dark inside. If he understands his situation he will refrain from making a fire because it will consume the air.
A few hours seems to be the upper limit... see : http://www.askabiologist.org.uk/answers/viewtopic.php?id=506
According to this source, some unlucky real life whaler got swallowed by one and survived a few hours. but I think that this happened pecause the whale was quickly put on air by the humans who freed the whaler, causing the whale to swallow lots of air. Usually, I think there is nearly no air in a whales stomach, so usually you would survive a few minutes due to oxygen lack.
A Big Fat Impossible
No whale has ever been recorded eating a human in history, and for a good reason. It’s basically impossible. I’m going to use a sperm whale for example. A speem whale, could theoretically swallow a human, but that human would be pushing it for any other whale. And an entire Cabin? No way, Jose.
Also, sperm whales dive down thousands of meters below the ocean, so that guy is going to be crushed by pressure before he gets to the stomach. Make this fish some type gen modified creature, and it could work.
I guess the creature would have to have a very big mouth for its size, and a very wide throat for its size, and a very big stomach for its size, if it is less than hundreds of feet long. Maybe if it is hundreds of feet long too.
So the log cabin floated down a river in a storm into a huge lake or the ocean, and the man sort of steered the log cabin toward an island somehow, but the island was actually a giant water monster that swallowed the man, the cabin, and a lot of water and air in one huge gulp.
The air in the stomach might make the creature unable to dive, but maybe the creature likes to float at the surface for days or weeks at a time. And maybe the stomach is on the top of the creature, with water at the bottom of the stomach and air on top. And maybe the stomach and large parts of the creature are transparent and there is light in the stomach for the man to see with, or he has flashlights or something to see.
And maybe the cabin was not swallowed by a mouth, but by some other orifice that leads into a different system than the alimentary canal. Maybe the body system was some sort of siphon for propulsion like squids use, & the cabin is stuck in a large sac storing water and air for later use in propulsion.
Or maybe the cabin is stuck in some vast space full of water and air inside the creature that the creature uses to generate very loud sounds to communicate with others of its kind across vast oceanic distances.
The Whale that "swallowed" our poor lad starts existence right around him after an incident with a spaceship drive that runs on improbability. His second-closest acquaintance - after the dude in his mouth - is a potted petunia. While still deliberating if he should swallow the thing on his tongue and what is up and down, the poor sperm whale impacts on the ground after having just fallen about 35 kilometers. You see, our Sperm Whale used to be an ICBM... And impacting the ground not only ends him and the Petunia but also the unfortunate guy.