Only if he stays onboard (and dies with you), don't believe you can remote-control a ship (yet), the closest ah've encountered is NPC Piloting squaddable-ships (and that was only for un/docking purposes)
But as for the first part: yes, they could trap you onboard, but you have the option of Dropping your character (or report them for possible abuse)
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.