All depends on how much you consume of both, and where your tolerance and experience stand with both. No one here can realistically answer for you whether or not you will be “safe” mixing the two, or even taking each just on its own.
To be frank, cocaine and MDMA mixed together is never really a good idea. The risks of damage to your heart and serotonin syndrome are very real when used in tandem, as the floodgates of dopamine and serotonin are opened up. This should not just be cast aside as a trivial concern.
For what it’s worth, the few people I know who have chosen to combine the two insist on doing the MDMA first and then doing lines of coke later in the evening. They have told me that doing it the other way around messes with the effects of the MDMA. But take that as secondhand info as this is not from personal experience, since I have never combined the two myself. And from personal observations of those who have, the comedown off both combined can be a real bitch as well.