For sex to happen, there must be some form of sexual tension; both parties must have raw, physical lust for each other.
Human relationships are complicated. They succeed and fail for reasons unbeknownst.
As mentioned here, when people get back together with their exes, it is almost always a recipe for disaster. With that being said, assuming that you are on good terms with your ex and that you two have had lots of sex in the course of your relationship, regardless, of why your relationship with your ex failed, the sexual tension you had with your ex will always be there. Therefore, unless you and your ex both have very low sex drives and barely fucked during the course of your relationship, maintaining a purely platonic relationship would be impossible.
With that being said, if you do end up hooking up with an ex, be sure to set the proper expectations with her and make it clear that you do not want to get back together.