Conspiracy - S1-E25
Revealing mistake: As Riker swings on Quinn, and a moment later, tossed onto a glass table, both times it can be seen that it's Riker's stunt double.
Conspiracy - S1-E25
Revealing mistake: After the fight with Riker, Quinn throws Worf through the room, hitting a wall. The replicator part of the wall moves.
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.