A pilot-scale experiment is carried out for treating mixed wastewater containing pharmaceutical wastewater (PW) and domestic wastewater (DW), by a process that is a combination of hydrolysis acidification-ozone-modified anaerobic–anoxic–aerobic-ozone (A2/O) (pre-ozone) or hydrolysis acidification-modified A2/O-ozone (post-ozone). The effects of different mixing ratios of PW and DW and pre-ozone treatment or post-ozone treatment on the removal of nitrogen and phosphorus and chemical oxygen demand (COD) are compared and studied. The optimal ratio of PW in mixing wastewater is 30%, which has the optimal COD removal efficiency and minimum biotoxicity to biological treatment. The pre-ozone treatment shows more advantages in removing nitrogen and phosphate but the post-ozone treatment shows more advantages in COD removal. Analysis of dissolved organic matter (DOM) demonstrates that post-ozone treatment has a more significant effect on the removal of fulvic acid and humic acid than the effect from the pre-ozone treatment, so the COD removal is better. Overall DOM degradation efficiency by post-ozone treatment is 55%, which is much higher than the pre-ozone treatment efficiency of 38%. Microbial community analysis reveals that the genus Thauera and the genus Parasegetibacter take great responsibility for the degradation of phenolics in this process. All the results show that the post-ozone treatment is more efficient for the mixed wastewater treatment in refractory organics removal.