Should I contact an editor at the journal that rejected my paper, to ask for feedback?
No, I don't think you should contact the editor. Journal editors are very busy people, and they don't have time to offer individual comments on every paper.

If you think that your paper did not get a fair review, for example if you have reason to believe the reviewer did not read or understand the paper, then that is worth contacting the editor about. But if you simply want to discuss the paper, the editor will likely view your request as not worth their time. They have already given you their comments on the paper, in the form of a rejection decision: in other words, the editor does not consider your paper appropriate for publication in the journal, and a discussion is not going to change that.

I also think asking for suggestions on how to improve the paper would be inappropriate, because you have already been given suggestions, in referee #2's report. My advice: make the improvements suggested by referee #2 and try submitting the paper to a different journal where it might be a better fit.