Chapter 17 of The Scarlet Letter, "The Pastor and his Parishioner", is about the encounter of Dimmesdale and Hester in the woods. During their conversation Dimmesdale asked Hester if she had found peace. Hester simply smiled and looked down at her scarlet letter. When Hester asked Dimmesdale the same question, he confessed that he had not found peace and that he was miserable.
Dimmesdale constantly sought support, strength, courage, and validation from Hester. The reason for this is that he lacked those exact characteristics. It is very possible that, when he asked her whether she had found peace, he did it with the hope that she would inspire him to find his own. However, his guilt had seared through him enough to weaken him physically, spiritually, and morally.
Another possibility is that he knew how much Hester grew as a human being since her scandal. He witnessed the strength and intelligence of the woman, and it is certain that he thought very highly of her as a person. He may have even found an admiration for her that made him feel even more disappointed at himself. For Hester did find peace through her ordeal, and her peace of mind was evident to everyone.
Hence, Dimmesdale may have asked the question to feel slightly better about himself. If she found peace, then he was no longer an agent of grief and pain. Yet, he still reveled in his own misery to inflict himself more mental punishment. That could have been another reason for him to have asked her.
Concisely, Dimmesdale saw in Hester the person he wished he could be: Strong, courageous, and dignified. He may have felt that, through her pain, he obtained his punishment. Through her peace, he may have obtained his redemption.