I've been in several live freeforms which worked like this; one-shots have more room to experiment, of course. (Also one in which the intrigue was based on a diplomacy-board-game-within-a-roleplay.)
It happened unplanned in a Cybergeneration game I ran once: the players (mostly as a prank on me) had one of the characters running a VR D&D game... which we proceeded to play out at the table. However, it was only intended as a one-session joke; the dynamic fell apart pretty quickly... not least because the teenage PCs in the top-level game were using their weird powers to cheat like hell in the D&D level.
That was a short-term gag, though, and the humour provides too much detachment. To do it seriously, you need to create reasons to identify, and care about, both sets of characters. Doing this on a sustained basis is difficult but by no means impossible.
World of Darkness's Changeling: The Dreaming is designed like this: PCs are simultaneously regular human beings and the ancient fairies spliced into their soul. This sometimes forces you to get in trouble fighting threats that no-one else can even see... and the damage system meant it was possible for the fairy half to 'die' to a magical threat and leave a very confused mortal to try and cope until the rest of the party could rescue them somehow. (Ignore nWoD Changeling: The Lost; it's a different premise.)
This doesn't change the game flow much compared to, say, other WoD games, because the characters are still integrated at both levels, and the game encouraged you to care mostly about the fae. But it could easily be GMed on both levels.
On the other hand, in R. Talsorian's Dream Park the characters are gamers playing characters of their own. I used to run this about 15 years ago; memory is fuzzy now but I recall that players were much more casual about risk to the 'bottom-level' character, as long as it wouldn't be a crippling loss to the 'top-level' PC.
It was important to provide motivations and plots that affect the 'top' characters as well as the current events, or the players (and GM) tended to forget they existed and play only the 'inside' RPG.
Issues to consider
Keep the system simple! People have enough to do tracking two layers of character, without fighting the mechanics.
Your plot should involve both levels of character, or else be about the confusion caused by being stuck at the 'wrong' level. If you don't have a plot that uses both layers, you don't have any actual need to do this at all - you're just complicating the game, not making it deeper.
Keep the plot more about one level than the other at any one time. Alternate focus between the 'outside' and 'inside' characters to involve both layers; save both-at-once for the climax - after everyone's had enough sessions to get the hang of it.
Campaign ideas
Simple and fun warm-up: a superhero game involving infiltrating the lead mob boss's operation. Everyone is a shape-shifter / illusionist / telepath capable of playing a criminal (or knocking one out and taking his place... until discovered.)
Plot complications arrive when other characters who know the heroes as themselves start to get involved with (not necessarily fight against!) the criminals they're playing.
The players are staff/security/gamers at a futuristic RPG VR park. When a commercial rival infiltrates saboteurs into the gaming groups, they all need to enter the game to figure out who's the enemy... before it's too late.
(This is the premise of the Niven/Barnes "Dream Park" novels. R. Talsorian published a tabletop RPG system for this, so you might want to take a look. The system is so-so, but the books are excellent reading... and a great demonstration of how to do action plots on both levels at once, involving the characters while they're playing other characters.
Avoid the published adventures; they were fun, but focused entirely on the 'inside' game, with no interest in the top-level PCs, which defeats what you're trying to accomplish.)
The super-high-tech Richard Morgan / Charles Stross identity confusion plot. Use Eclipse Phase, which has the total separation of identity and body as the game premise. By accident, the stored/backed up minds of the players are restored in someone else's bodies. They have to pretend to be who everyone thinks they are long enough to escape... as if the deception is discovered they'll be forcibly uploaded back to storage in a memory bank so the 'real' owners can have their bodies.
Everybody is dead. The players are ghosts who have to possess and influence living mortals to solve the problems that keep them angry and undead. But they'll have to help solve the problems of their mortal hosts to do it. (Pace Lo'oris, I think you mustn't allow outright puppet-like control, or you'll lose the two-layer depth!)
For a party game that works like this, check out Knizia and Jacklin's "Hollywood Lives", in which the players play actors and directors competing for the best parts. It's a one-session con game or a party game more than a tabletop, but it's a nice simple introduction to doing two layers at once. Effectively it alternates focus in about 15-minute intervals between the actors and the film characters.