Creator God is certainly capable of making a fish large enough to swallow a human, and we even hear occasional reports of humans who were temporarily swallowed by fish, and yet survived!
At the same time, we know the Bible is not a science textbook. For example, in Matthew 5:45 when Jesus says that the Father “causes his sun to rise on the evil and the good,” he is not giving an astronomy lesson, suggesting that the Sun revolves around the Earth. Rather, he is using a familiar way of talking about the appearance of things to make a point about God’s wide-ranging love. Not all biblical genres are literal and it’s possible the story of Jonah is simply a legend with a lesson, not much different than some of Jesus’ parables.
Because both explanations are possible, it is important to remember that for the actual purposes of the book of Jonah, it doesn’t matter whether it’s literal or legendary. Either way, the story still serves to encourage us to be faithful to God’s calling and not to “run away” from his voice.