Yes it's possible to replace parts with better ones. A depot slot is empty? Just dismount the part and mount the other one.
your next question:
Of course you can send the officers on both subs send them ("dismiss") to the depot and from there to the other sub.
But it (transferring officers) needs much more time than for other crew members. And you can use a crew only on 1 (one!) sub by time, concurrently.