Dimmesdale needs to escape from Chillingworth because Chillingworth knows that Dimmesdale is Pearl's father. Chillingworth has been persecuting Dimmesdale with this knowledge for much of the book.
Dimmesdale finally escapes Chillingworth in kind of a strange way. He confesses his sin in front of everyone. This takes away Chillingworth's ability to blackmail him. So Dimmesdale does not escape from Chillingworth by running away from him physically. Instead, he gets away by destroying Chillingworth's hold over him.
Once this happens, it is as if Chillingworth has lost his reason to live. He dies soon afterwards.
In the book "The Scarlet Letter" the Reverend Dimmsdale has been hounded and questioned by Chillingsworth throughout his life. Dimmsdale carries internal guilt at having let Hester Pryne be subjected to humiliation and punishment for having a relationship with him. The relationship was never told by Hester. Dimmsdale has been able to serve as pastor for the townspeople because of the secret.
Chillingsworth discovered the truth. He is a doctor and Dimmsdale has been his patient. As the years of their friendship progressed he had become more and more curious about the secret that Dinmmsdale keeps. Dimmsdale had never let the physician see his chest during examinations. Chilligsworth secretly opens Dimmsedale's shirt.
On the day that Dimmsdale is to give a speech to the crowd, he calls Hester and Pearl up to the scaffold with him. He reveals the truth about his relationship to Hester and pearl. He falls down deathly ill and opens his shirt reveling a letter "A' imprinted into his chest.
At the end of the story the reader is told that Chillingsworth has grown old. He dies leaving his money and wealth to Hester's daughter Pearl.