I am friends with my ex husband but we share a daughter. We’d likely not maintain friendship if we had no kids together.
It doesn’t effect our romantic connections. We are both happily married. Our spouses are also friendly with them and with each other
Is there a particular reason you want to be friends with exes?