The only animals which could swallow an adult human whole without tearing their bodies apart first are giant constrictor snakes, which squeeze their prey to death first before swallowing, to avoid the scenario in the question where the prey could damage their digestive system.
And large adult male sperm whales. If a human is oriented correctly, it can be swallowed whole and thus possibly alive by a large adult male sperm whale. I am not certain about the ability of smaller sperm whales.
However the story about James Bartley being swallowed alive by a sperm whale is fictional.
https://www.australiangeographic.com.au/topics/history-culture/2017/03/did-a-19th-century-sailor-get-swallowed-by-a-sperm-whale-and-survive/#:~:text=Historians%20have%20since%20concluded%20that,stomach%20of%20a%20sperm%20whale.
https://en.wikipedia.org/wiki/James_Bartley
https://www.snopes.com/fact-check/fisherman-survived-inside-whale-for-three-days/
However, it should be possible for a large adult male sperm whale to swallow a man whole, and thus alive if they are live at the time.
In one scientific book a list of the normal and unusual contents found in the stomachs of sperm whales included a human cadaver. And the word cadaver indicates to me that it was someone wrapped up in a sack, weighted, and buried at sea to be later swallowed by the whale instead of someone alive when swallowed.
I once read a mention of a fight between whalers and the legendary great white whale Mocha Dick, a main inspiration for you-know-who, where Mocha Dick allegedly swallowed two whalers who fell into the water. I don't know if Mocha Dick actually swallowed them or they just fell into the water near his mouth and sank due to the weight of their clothing, and the witnesses imagined Mocha Dick swallowing them.
I once read of another incident where a harpooned sperm whale smashed a whale boat possibly by biting it in half, and then submerged carrying a man in its mouth. The other whalers must have though he would certainly drown or be eaten. But the whale came back up, tossed the living man onto floating wreckage, and dove again.
So if you were being attacked by a pack of wild animals would you rescue one of them which got injured? Maybe the whale didn't know that the human was one of its attackers.
Suppose you are walking through bushes when you feel a sudden stabbing pain in your back and you run away without looking back to see what's attacking you. Suppose you run into a bush and knock a bird's nest with a baby bird onto the ground, and stop to pick up the nest and bird and put them back in the bush, and then resume running for your life.
Wouldn't that be a very kind and considerate thing for you to do? And wasn't returning a man to the surface be a very kind and considerate thing for the whale to do while being attacked?
Anyway, I once read of a man who crawled down the throat of a dead large adult male sperm whale to reach the stomach. I think he would have been very stupid if he didn't have a rope tied to him and people ready to pull him out if he got stuck. Anyway his example seems to show that the throat of a large adult male sperm whale could be wide enough for the body of a man to pass through if in the correct orientation.
And I once read of a dead sperm whale tourist attraction where people could walk down the throat and into the stomach. Although I suspect that the operators of the attraction excavated to make the throat and stomach larger than when the whale was alive.
Anyway whale scientists who have dissected sperm whales of various sizes should have measured the diameters of the throats and stomachs of those whales and should have a good idea of the relationship between overall length and throat diameter.
This site claims it is very, very improbable for a living person to be swallowed alive by a sperm whale.
And some experts claim that it may theoretically be possible for a sperm whale to swallow a person whole, though there are two problems with this. One is that the sperm whale’s dagger-like teeth would likely kill the prey first, in which case you’d be long dead before suffocating in the whale’s several stomachs. But this point is rendered mostly null, as sperm whales only feed deep beneath the surface of the water and would never view humans as prey. So any accidental swallowing would have to derive from a rather bizarre sequence of events.
http://www.todayifoundout.com/index.php/2020/07/so-how-do-animals-swallowed-alive-actually-die-and-do-any-animals-ever-get-out-alive-after/
I note that Sperm whale teeth are actually rather blunt, not dagger like, so how much they hurt a person would depend on how hard the whale bit down. If the whale bit with full force it would be like having a drawbridge fall on you.
I note that healthy sperm whales have been found which were toothless, and others with malformed lower jaws which couldn't close on the upper jaw, and even one without a lower jaw. Apparently such whales feed by sucking in their prey and often don't bite on the prey.
It does offer some helpful stories about how some animals do manage to survive being swallowed alive.
And Wikipedia says:
While the veracity of the story is in question, it is physically possible for a sperm whale to swallow a human whole, as they are known to swallow giant squid whole.[11] However, such a person would be crushed, drowned or suffocated in the whale's stomach.[editorializing][citation needed] Like ruminants, the sperm whale has a four-chambered stomach. The first secretes no gastric juices and has very thick muscular walls to crush the food (since whales cannot chew) and resist the claw and sucker attacks of swallowed squid. The second chamber is larger and is where digestion takes place.[12]
https://en.wikipedia.org/wiki/James_Bartley
So a large adult male sperm whale would be about the minimum size creature which could have a throat wide enough for an adult human to crawl down to reach the stomach and attack the stomach.
Could land animals that heavy exist?
The sperm whale is the largest toothed whale, with adult males measuring up to 20.7 metres (68 ft) long and weighing up to 80 tonnes (79 long tons; 88 short tons).[36][37][38] By contrast, the second largest toothed whale (Baird's beaked whale) measures 12.8 metres (42 ft) and weighs up to 14 tonnes (15 short tons).[39]
https://en.wikipedia.org/wiki/Sperm_whale#External_appearance
Though much larger ones have been reported.
Anyway, the most massive sauropod dinosaurs had weights estimated to be even heavier than the most massive sperm whale ever weighed by humans. Their necks are slender compared to their bodies, but some of them could have throats several feet wide.
Thus animals with enough mass to possibly have throats wide enough to swallow humans can walk on land on a planet with 1 g surface gravity and an atmosphere similar to that of present day Earth.
But of course no carnivorous land animal ever had more than a fraction of that size.
Though their throats should have been narrower, they do show that creatures with the weight of large adult male sperm whales, and thus possibly having throats as wide as sperm whales, could walk on land on a planet with a surface gravity of 1 g and an Earth like atmosphere.
And just for fun, here is a link to a image from a Prince Valiant comic strip in the 1930s where he fights a giant sea crocodile.
http://aprincenamedvaliant.blogspot.com/2011/11/sir-gawain.html
I think in the 198s there was rather similar plot with a giant lizard crawling toward Camelot. And in about 1960 or so I have a dim memory of a full page panel where a knight on foot with a sword faces a giant crocodile with the mouth opened wide enough it looked like the knight could have stepped inside the mouth.
And that reminds of an illustrated children's book from decades ago where a Chinese boy confronts a Chinese dragon that looks a lot like a crocodilian. I remember one illustration where the dragon's mouth is propped open with a pole and the boy is in the mouth walking toward the throat. As I remember, he goes inside the dragon to either kill it or help it.