The Best of Both Worlds (1) - S3-E26
Revealing mistake: During the phaser battle on the Borg ship, a detonation wire is seen attached to the right foot of the drone that Beverly kills.
The Best of Both Worlds (1) - S3-E26
Other mistake: When O'Brien activates the transporter, only the very bottom indicator lights come on, even as he moves his hand up. Usually the indicator lights match the movement of the hand.
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.