What is the title of the book within Star Wars Legends that contains the story about how Boba Fett escapes the Sarlacc pit?
Boba Fett was established as having survived The Battle of the Great Pit of Carkoon in The Dark Empire comics, but how he survived is left rather vague, simply saying
The Sarlacc found me somewhat indigestible.
This was initially published in Dark Empire issue 5, released in August, 1992.
There are a few stories that deal with the actual story of his survival and escape.
The first, and most detailed is A Barve Like That: The Tale of Boba Fett, which was published as one of the stories in Tales from Jabba's Palace, published in January 1996. This is the story that focuses on the escape itself.
It is summarized on Wookieepedia as:
Boba Fett is being eaten by the Sarlaac. During the Battle of the Great Pit of Carkoon, Boba Fett fell victim to the Sarlaac and is now being slowly digested. Susejo a previous victim of the Sarlaac talks to Fett in his head, telling him stories of a Jedi that the Sarlaac had once eaten. But Fett is not interested. Boba Fett focuses on surviving. He focus on becoming the first individual to ever escape from the belly of a Sarlaac.
It details Dengar finding Boba Fett having just survived his escape from Sarlacc. This story deals mostly with Dengar nursing Fett back to health, and only relates a little information of the escape itself.
The trilogy is summarized as
The Bounty Hunter Wars trilogy was written by K. W. Jeter. It details the events of Boba Fett, Dengar, Neelah, and Kuat of Kuat starting just days after the battle at Jabba's Palace and Boba Fett's escape from the sarlacc pit. The trilogy makes extensive use of bounty hunter characters from Star Wars Episode V: The Empire Strikes Back and Tales of the Bounty Hunters, including Zuckuss, 4-LOM, Dengar, and Bossk.
The scenes regarding Fett's survival and escape are from the early portions of the The Mandalorian Armor book, and is an expanded retelling of the A Barve Like That story meshed with the Payback: The Tale of Dengar story, mostly as a setup for the rest of the books. If you've read the previous two stories by this point, you've already gotten most of the pertinent information.
His survival also appears in the marvel starwars comic, i want to say issue 81 or 82, that came out just after Jedi. The sarlaac spit him out, and if I remember correctly at the end of the story he's in one of the Jawa Sand Crawlers that go back in, but I would assume that if it couldn't digest him, it couldn't digest an entire ship either.
I remember reading that he used explosives and that the juices from the Sarlacc ate through his armor and disfigured him if you go by the Dark Horse Comics and the Bounty Hunter Wars