Aside from the post-9/11 anti-hijacking doors etc., mainly just complexity and the crews, staff & security.
It takes a lot in terms of ground crews and other airport staff to prepare a plane for operations, and when they do that, they’re expecting to use it and will tend to notice if someone tries to get in the pilot seat.
Once in the pilot seat, even if the plane is ready and somehow no one notices them getting in there for a bit, there are quite a few things to figure out and do.
But it is possible and has happened to private, commercial, and military aircraft… very rarely.
SPACE STATIONS? Space stations are in space (...) and have air locks and are usually occupied by astronauts. To open the air lock, you need to figure out how to operate it from the outside without being overridden by the occupants and/or ground control. And/or build your pirate spaceship to have breaching equipment…