You can argue that the first modern novel was one of these. 'Ivanhoe' has hella issues, obviously, but when I read through it in grade school you better believe my Robin Hood loving butt was psyched to see my hero show up in the middle and set things straight.
Given the proliferation of the various Herlock Sholmes style expies, that pretty much already exists.
And OCs for various fandoms are just another way of putting your own dolls in someone else's playhouse.
It all comes back around.
A recurring theme in late medieval literature is stories which are ostensibly tales of King Arthur or Robin Hood or some other popular or legendary figure, except in practice the narrative mostly concerns the tribulations of wholly original characters, with the figure the story is purportedly about appearing only briefly, often in a peripheral or supporting role, essentially as an excuse to use that figure's mythos as a framing device for original fiction.
You occasionally bump into a similar conceit in contemporary fan-media, but I have to wonder how widespread the device would be if it weren't for the warping influence of copyright on popular culture. Imagine if there was an entire body of respectable mainstream fiction, spanning a wide range of genres and mediums, unified solely by the fact that somewhere in the middle Batman shows up.