Yes. Oftentimes molly is cut with other drugs like cut with fentanyl to intensify the effects of molly, which may lead to overdose. As with any unregulated drug, the production process is opaque.
Illegal manufacturers prioritize profit margins over the well-being of their customers. What goes into the drugs is not about safety but rather creating the most powerful effect for the lowest price.