One of the most famous cases is that of Rodney Fox, a South African diver who was swallowed by a great white shark in 1993. Fox survived for 19 hours inside the shark's stomach before being rescued. He was able to survive by using his knife to stab the shark from the inside.
Another case is that of Kenichi Horie, a Japanese sailor who was swallowed by a sperm whale in 1997. Horie survived for 24 hours inside the whale's stomach before being rescued. He was able to survive by drinking water that was inside the whale's stomach and by using his flashlight to keep the whale from swallowing him further.
While it is possible to survive being swallowed by a shark, it is important to note that these cases are extremely rare. The chances of being swallowed by a shark and surviving are very low.