Cocaine is a DRI (dopamine reuptake inhibitor) However, it also facilitates the release of both dopamine and serotonin. MDMA on the other hand just exacerbates the release of serotonin and dopamine without any inhibition to the body's ability to reuptake these neurotransmitters.
MDMA could possibly desensitize the receptors prior to the cocaine usage and mitigate the actual high you achieve. Is it safe to have these two compounds close to each other? NO!
From what I've read on if used simultaneously the dopamine could actually become neurotoxic to serotonin axons. MDMA is technically neurotoxic within itself.