Yes, as long as (a) you liked each other as people, independent of loving each other as romantic partners, and (b) neither of you actually wronged the other.
The longer version
It’s possible. I’ve done it several times–including with an ex-husband, who continues to be one of my best friends and whom I adore. The general case It’s unusual, I know, but I strongly suspect that it’s unusual because there’s a sort of societal acceptance to distance ourselves from someone who hurts us; it’s normal and widespread to hear people say that their ex was a horrible person. So when someone breaks up with us, we fall into that comfortable, easy pattern. But when someone says that all or most of his/her exes are bad, or crazy, or similar, I wonder to myself, “What does it say about you and your judgment that you picked this person as your partner? And what does it say about you that you are not taking responsibility for your part in the deterioration of the relationship?” Let’s be clear: if someone lied to you, cheated on you, stole from you, manipulated you or in some similar, defensible way betrayed your trust, then I don’t think you can be friends–why would you want to be friends with someone like that? But sometimes relationships change because people change and/or circumstances change, or because we, being young, or naive, or inexperienced, make mistakes. Sometimes love dies. It happens, and it doesn’t have to be someone’s “fault.” A specific case: me In all my relationships, romantic or otherwise, I look for people who are principled, kind, honest and thoughtful. These are people who aren’t going to lie, or cheat, or do things that are stupid or malicious. So if the relationship comes to an end, it’s for normal reasons–even if it hurts, it’s not a “bad” thing. Because I select partners who are good people, we are able to weather out the difficult aftermath of the end of the relationship, and resume our friendship. We can do this because we have a history of trusting each other; we know we wouldn’t knowingly or deliberately hurt each other. My divorce was painful in ways that I still can’t fully articulate, and it was painful for me, for my ex-husband, and for our families. But through everything, my ex and I kept the channels of communication open and we continued to affirm our fundamental affection and respect for each other. It’s hard work. But he’s worth it to me, and I’m worth it to him. My ex-husband was my friend before he became my boyfriend, and after the divorce, he continues to be one of my closest, dearest friends.