Many works of fiction, Dickens in particular, are set against a historical backdrop based on fact. Otherwise, the novels would have little relevance to most people (unless it is science fiction). By reading these novels, you can almost place yourself in a particular place at a particular time. That is what makes much fiction so compelling. I happen to be reading a WW2 novel called "From Here To Eternity" and I feel as though I am on a Hawaiian Army Base in the summer before Pearl Harbor.
So while the characters in a novel are usually fictitious, the setting that they exist in is often clearly rooted in fact.