Continuity mistake: In the beginning of the episode, Riker, Geordi, Worf, Data, and Pulaski are playing poker. Pulaski puts two neat stacks of chips in the center beside some chips in a pile. It then shows Worf putting similar stacks in the center but Pulaski's stacks are not visible and they should be. Then when Worf wins the hand, the camera is showing a wide shot of him pulling the chips towards him and you can see his and Pulaski's neat stacks of chips.
Continuity mistake: When Data is dealing the cards for 7-card stud, they show him dealing 1 card to everyone. In the close up, he's now dealing everyone a 2nd card. When it cuts to his hands however, everyone only has 1 card and he's dealing them a 2nd card again.
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.