No, it is not safe to touch the outside of a microwave oven while it's running or immediately after it has been turned off. Microwave ovens generate electromagnetic radiation, specifically microwaves, to heat food. These microwaves are contained within the oven's metal enclosure, and the mesh on the door's glass prevents them from escaping.
However, there can be some leakage around the door and other small gaps in the oven's casing. The microwave's safety design limits this leakage to very low levels, which are considered safe during normal use. The microwave is designed to be safe as long as it is in good working condition and not damaged.
Nevertheless, touching the outside of a running microwave can still be dangerous, as it may become hot due to the heat generated inside while cooking. Additionally, if there is any damage or malfunction in the microwave, it could lead to increased radiation leakage, which is hazardous.
It's best to avoid touching the outside of a microwave while it's running and wait a few minutes after it's been turned off to allow any residual heat to dissipate before touching it. Always make sure your microwave is in good working condition, and if you suspect any issues, have it checked by a professional.