Despite advances in membrane technology, the separation of complex oily wastewater using membrane filtration remains a daunting challenge for the industry. Recent approaches including membrane modification with two-dimensional (2D) nanosheets, showed susceptibility to swelling, fouling, and instability during operation. As a game-changer approach, a polyacrylonitrile (PAN) UF membrane modified with 3D nanostructured composite of MXene and O-MWCNT was introduced for the first time to treat complex oily wastewater. The composite membrane showed high separation performance of soluble dye-oil-water emulsion while maintaining high water permeability. Moreover, during the operational period, the composite membrane exhibits excellent antifouling and anti-swelling properties due to the synergetic effects conferred by the 3D nanostructures. Furthermore, the composite membrane possesses remarkable chemical stability evidenced by its high corrosion resistance when exposed to a strong acid (3 M HCl) and oxidant (NaOCl) solution for a long-time period. Overall, the operational stability was maintained in terms of flux and high rejection of oil and dye over a 45 h long-term operation. Consequently, this work provides an innovative, stable, and highly facile process for fabricating scalable UF composite membrane for the treatment of complex oily wastewater in a harsh chemical environment.