Can I lock my doors?
Solution 1:
No it's not - if you require this level of control the best method to achieve it is to pause the game (space bar) and then manipulate the state of the doors manually.
If this is to vent atmosphere to space for every compartment except the ones your crew are in then the way that I would achieve this is to pause the game and open all doors by double clicking, and then close the doors that I didn't want open. As the game is paused while doing this opening the exterior doors will not vent the atmosphere from your ship until you unpause the game.
If this is being used as a method of killing boarders, then it's also probably not the best way of dealing with the situation. In these instances what I would do is just vent the individual compartments that the boarders are in so they have to break down doors to get to the next compartment so that you have at least one set of compartments between the boarders and your crew - in the event the boarders break into the compartments that your crew reside in while you're venting atmosphere, you will immediately vent the compartments that your crew are in as well with nowhere for them to escape to.