Where Silence Has Lease - S2-E2
Revealing mistake: When the black deck officer is supposed to be dead you can see the actor's nostrils flaring as he is breathing.
Revealing mistake: As Data cautions La Forge not to say anything, his actual flesh tone is visible on his palm.
Revealing mistake: When looking at Kolrami, the line between his make up and actual skin tone can be seen between his scalp, hairline, and the back of his neck.
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.