In those books literary fiction characters (most notably Jane Eyre) exist in a reality which can crossover, but there are also those in his Nursery Crimes series which does a similar thing with nursery rhyme characters.You really have to start with Jasper Fforde’s superb Thursday Next stories.
No one has mentioned Redshirts by John Scalzi.
Where the less important crew of a starship slowly discover they are actually extras on a fictional pulp TV show from the past, and so endeavour to prevent themselves being written out out of the script. In many ways, quite similar to Galaxy Quest.