Should I thank the editor for accepting my paper?
I don't see anyone reason why you shouldn't. Although, don't thank them for accepting the paper. A good editor will accept an article by someone they dislike or they wholeheartedly disagree with but which makes a good argument. It's their job. It's not a favor to you personally.

In addition, you can mention it where you acknowledge everybody else who contributed with their comments. It's not uncommon to see papers whose authors thank editors or (anonymous) reviewers for their comments if they went beyond what is ordinarily expected of them.  This seems to be the case here.