Molecularly imprinting polymers (MIPs) are typically prepared using a single template molecule, which allows selective separation and enrichment of only one target analyte. It is not suitable for determination of complex real samples containing multiple analytes. In order to expand the practical application of imprinted polymers, novel dual-template magnetic molecularly imprinted polymers (MMIPs) were synthesized by surface polymerization using hydrocortisone and dexamethasone as the dual-template molecules in this study. The dual-template MMIPs were prepared by copolymerization on the surface of Fe3O4@ SiO2-NH2, the template molecules, the functional monomer acrylamide (AM), the cross-linking agent ethylene glycol dimethacrylate (EGDMA), and the initiator 2,2-azobisisobutyronitrile. The morphology, magnetic properties and adsorption characteristics of the obtained dual-template MMIPs were studied by field emission scanning electron microscopy, dynamic light scattering, Fourier transform infrared spectroscopy, thermal gravimetric analysis, and vibrating sample magnetometry, and re-binding experiments. The results indicated that dual-template MMIPs had uniform particle size, strong magnetic properties, high thermal stability, and good mass transfer rate. To investigate the selectivity of dual-template MMIPs, the template molecules were mixed along with their structural analogs. The dual-template MMIPs revealed a significantly higher adsorption amount for the template molecule than its structure analog. The dual-template MMIPs can be used for the enrichment and determination of hydrocortisone and dexamethasone in cosmetic products with the recoveries of spiked cosmetic samples ranging from 86.8–107.5% and 91.2–104.3%, respectively. The relative standard deviation (RSD) for hydrocortisone was <2.89%, and RSD for dexamethasone was <2.62%.