A friend can give you access to his ship. If you remain in the Entrance Room, though he can fly away from your ship or however you accessed his ship, it would still be possible for you to escape by having someone else fly to the same location and give you access.
If you go further into the ship, its entirely possible he can lock doors behind you, preventing you from reaching the entrance room again.
As for killing by sunning, only the pilot dies - others merely go unconscious. However, as Jevon mentioned, there is a way to swing it to kill a passenger, but its a Golden Rule violation and will result in penalties from the ASims.