There was an entire TNG episode (Season 6, Episode 12) whose plot centered around this:
spoiler
Moriarty was reactivated by mistake, and took the ship hostage, demanding to be able to leave the holodeck.
Geordi and Data spent half the episode experimenting with beaming (inanimate) holographic objects off the holodeck, to no avail. With that said:
spoiler
Their transporter turned out to be a holographic fake (and so was Geordi), so who knows if the results were valid.
The EMH is never shown with pips on Voyager. The “ECH” was shown with pips appearing on its first appearance, however:
spoiler
The entire ECH subroutine was created as the result of The Doctor’s daydreaming, so the visualisation of a rank appearing out of thin air makes sense in that context.
The only other time the ECH mode was used in a genuine emergency (Season 7, Episodes 16/17), he did not have pips.