Because the ritonavir inhibits one of the enzymes that breaks down MDMA, it can increase the potency of the MDMA, which can increase the risk of overdose.
This isn't an insurmountable problem. As long as you are cautious in the dosage of MDMA that you take, it should be possible to safely use while on this medication. (So, start with a small dose and see how things go if you're determined to try it.)
One of the unknowns that I think deserves mention is that MDMA is hard on your immune system. Even with medication, you are partly relying on the health of your immune system to keep the HIV virus in check, so it may be possible that using MDMA (or any other drug use that stresses the system) could reduce your resistance to the HIV infection getting worse.
If you really want to try it, I think it can be done with reasonable safety, but don't make a habit of it and keep dosages reasonably low.