If you log off in a game-generated station you're safe. As well, if you successfully log off in space you will also be safe as I recall.
But if you log off somewhere that's destructible I'm fairly certain you could lose that ship if the facility itself is blown up. But in that case you're likely part of an alliance that will bankroll you a new ship from their industrial war engine.
There are mechanics that protect assets in player-owned (and therefore destructible) structures, so long as the station is properly fueled and maintained in known space. Your stuff gets whisked away to a nearby NPC station, where several days later you can retrieve it for a certain percentage of its assessed value.
Of course, should the station owners fail to maintain said station (you'll get a notification if the structure goes low-power), or you're bold enough to park assets outside of known space (wormholes, Pochven, etc)...upon destruction about 50% (random chance, the Loot Fairy is quite capricious) of your stuff can wind up in a big debris cloud affectionately known as a "loot piñata".
Destroying an abandoned station is quite easy, the real problem is snapping up the haul before rival raiders swoop in for a fight.
If you log off in a game-generated station you're safe. As well, if you successfully log off in space you will also be safe as I recall.
But if you log off somewhere that's destructible I'm fairly certain you could lose that ship if the facility itself is blown up. But in that case you're likely part of an alliance that will bankroll you a new ship from their industrial war engine.