I think this depends so much on individual circumstances. You must both put your children first, as others have said. If you agree on that, then you have a good basis for going forward.
Once the divorce is through, if you both put all the shit behind you, and focus on moving forward, it will help a lot. What’s done is done. You can’t revisit it or keep on fighting it some more. That doesn’t help anyone, and just makes it harder to work together to make this difficult time for the children any easier.
(I should note, that none of these things are easy, but they are principles from which you can guide your actions)
Individual circumstances: if either of you has to keep on fighting, or using the kids as weapons, then friendship is unlikely. If you both agree that your goal is to, if not become friends, at least become good partners in this child-raising business, that will help.
Money will probably be a sore point. You’ll both probably feel like the other is getting too much. Remember that. I don’t know if it helps or not. I think it does. It allows you more compassion for the other. This is important, especially when they have hurt you.
The other thing is to remember that there is always guilt on both sides of a marriage that breaks apart. If one person had an affair, it is partly because the other move away emotionally. You both want connection and love, and you couldn’t figure out how to get that from each other. That’s extraordinarily painful. Depression might be really, really the worst thing you ever experience, but so is losing a love.
Given that you both hurt, the odds are small, but maybe you can figure out how to parent at a remove.
As time goes by, and you build on co-parenting, and you each have new relationships, you have a better chance of seeing each other empathetically, and that might allow you to become friends. Indeed, sometimes people become so friendly, they remarry. Isn’t that a kick in the head? My point is that good relations can develop.
I surely hope things work out as best they possibly can. If you are strong, you can be kind to him for the sake of your kids, and if he is wise enough, he’ll be kind to you for the same reason, and they you have an excellent chance of making the best out of a bad situation.
Then again, what the hell do I know. I’ve never gone through this, and I only got close…. well, that’s a story for another day.