You can launch, self-destruct, and take the "Sidewinder back in the Bubble" option. You can then transfer-off any other ships you had on the Carrier.
Of course, you'd lose the ship you self-destructed in. If the Carrier sells ships, you could buy a stock ship and self-destruct in that.
If it doesn't, but it has a shipyard, you can launch in your most expendable ship (even if you first have to transfer it to the Carrier). It's probably a good idea to have a designated "most expendable ship", reasonably cheap and with no engineering, therefore completely replaceable with credits. I have an Imperial Eagle for this, with Enhanced Performance Thrusters, boosts over 600m/s without engineering.
If you're in a ship you don't want to lose, and the Carrier has no shipyard, then I think you're stuffed. You are probably also stuffed if it had a shipyard but the Carrier owner suspended that service.