Yes of course you can extract pills and clean up whatever they contained, if money isn't an issue. Needless to say this will not be cheap, so you have to decide if it's worth it.
Have a look at column chromatography, this will allow you to separate whatever components are in the pills, even MDA/MDMA.