Revealing mistake: In Amanda's quarters, when she repulses Q, as he flies toward the corner, you can tell it is his stunt double.
Revealing mistake: In the cargo bay, as Riker stands alone, through the whole scene where a case is about to hit him, you can tell it's a stuntman with a bad wig.
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.