First, compounding has been around us since the advent of pharmacies. Also, compounded pharmacies have revived over the last few decades because of advancements in technology and research methodologies. According to the FDA (Food and Drug Administration), compounding prescriptions are ethical & legal if prescribed by licensed practitioners for patients and prepared by a licensed pharmacy, such as Aurora Compounding.
Provincial boards regulate compounding operations to ensure that compounded drugs pharmacies produce are safe for patients. To cut a long story short, compounding is legal and safe, provided that you get medicine from a licensed pharmacy.