True. We don't see that much either, but I seem to recall times people are contacted similarly to Picard, while in the holodeck, which to be fair isn't really the same as someone being cleared to enter or not, but because I'm bored, & intrigued, & this is the last month I can source through Netflix for such a thing, I'm gonna figure out all the times on TNG someone's entered someone else's programThat's a fair point!
But how many times have we seen people announcing themselves, or ringing the door, or otherwise making contact with people on the holodeck without barging in?
Off the top of my head, the only time I can think of is Data phoning Picard, the example @NewHeavensNewEarth gave earlier. There may be others, though!
Farpoint: Riker into Data's wilderness program
Haven: Troi & Wyatt into Riker's landscape program
The Big Goodbye: Beverly into Picard's Dixon Hill program, prearranged invite
1001001: Picard into Riker's Minuet program
Pen Pals: Data into Picard's horse-riding program
Manhunt: Data & Riker into Picard's Dixon Hill program
The Emissary: Worf into K'Ehleyr's Worf authored combat program
Booby Trap: Picard into Geordi's Leah program
Hollow Pursuits: Multiple people into Barclay's fantasy programs twice
Clues: Guinan into Picard's Dixon Hill program, prearranged invite
Galaxy's Child: Geordi into Leah running his own Leah program
The Nth Degree: Everyone into Barclay's interface program, likely invited
New Ground: Worf into Alexander's Worf authored combat program
The Cost of Living: Troi & Worf into Lwaxana & Alexander's party program
Relics: Picard into Scotty's NCC-1701 no bloody A,B,C, or D program
A Fistful of Datas: Troi into Alexander's "Ancient West" program, prearranged invite
Ship In A Bottle: Barclay into Moriarty's Countess program, on the holographic holodeck
Rightful Heir: People into Kahless' throne room program, seemingly open to the public
Descent, Geordi into Data's Borg killing program
Homeward: Worf into Nikolai's Boraalan migration program, invited
Thine Own Self, Riker into Troi's command sim program, not proctoring it this time apparently
Bloodlines: Picard into Jason Vigo's rock climbing program
So about 17 times someone goes in unannounced, some of which are arguable or explainable, but is still surprisingly more than I expected. Coupled with the fact that only a few times do people go in with consent, most of which are prearranged, I guess it does seem very much like it's just a natural social convention that people will walk in on people running programs unannounced
Although, in almost all cases, they are looking specifically for the person they've tracked there, & being officers, could've cleared themselves to go in, based on the fact that they needed to find them. Plus, it's always our main characters doing so, who are close with one another enough that they might have friendly enough relations, that they alone might consider it acceptable to do so to one another.