The central theme of the novel is found in Ch.22, when Herbert tells Pip (Handel) the story of Miss Havisham. He remarks that his father always believed that "it is a principle of his that no man who was not a true gentleman at heart, ever was, since the world began, a true gentleman in manner. He says, no varnish can hide the grain of the wood and that the more varnish you put on, the more the grain will epxress itself."
Dickens seems to say that if at heart you are an evil person then no matter how much you pretend to be good, your true evil nature will be exposed.
This is true of Compeyson the lover of Miss Havisham who "practised on her affection in that systematic way, that he got great sums of money from her." Ch22.
In Ch.51, Jaggers tells Pip how he was moved to pity on seeing Estella the orphaned daughter of Magwitch and Molly and decided to find her a foster parent, "put the case that he lived in an atmosphere of evil and all he saw of children was their being generated in great numbers for certain destruction." Magwitch, tells Pip and Herbert in Ch.42 that he was a victim of such social circumstances.
Magwitch was essentially a good person at heart but because he was an orphan and because of the prevailing social circumstances he becomes a criminal and is arrested by the police. But, Compeyson who was born a gentleman is actually an evil minded person who swindles Miss Havisham of all her money with false promises of marrying her. Dickens, thus illustrates how good and evil are intertwined in these two characters.
Finally, both of them are arrested by the police and face trial. In Ch.42 Dickens reveals how crooked the legal system is. The judge is decived by the outward appearance of Magwitch and Compeyson. Since, Compeyson was dressed like a gentleman and behaved like one he was sentenced only for seven years, but Magwitch because of his superficially seedy appearance got fourteen years. This is the situation in which 'good' and 'evil' are intertwined.