Medical oxygen is CERTIFIED to contain above a certain percentage of oxygen, and below a certain percentage of impurities. The tanks are certified to be cleaned to a certain standard so that there are no impurities added to the gas by the tank itself. Welding oxygen is sold without that certification, and put into tanks that are not guaranteed to be that clean.
In practice, both come from the exact same process. Air is liquefied, distilled to separate the oxygen and nitrogen, and the liquid oxygen is evaporated to form gaseous oxygen to fill the tanks. This process produces oxygen that exceeds either purity standard. In practice too, any impurities in the tanks might be combustable, and cause an explosion when exposed to the high pressure oxygen, so both tanks are cleaned better than they have to be.
Quite fine about breathing welding grade oxygen if I needed it and no medical grade was available, as long as the welding regulator and hoses had been cleaned. Since welding oxygen regulators usually live in garages and shops, not hospitals and clinics, there could easily be a lot of contamination in the regulator and hoses that you wouldn’t find in a medical setting.
I’ve heard from various sources that welders in shops with oxyacetylene torches routinely suck oxygen direct from the torch as a hangover cure, and I’m quite confident that the risk there is more from welding while drunk than from using a nonmedical oxygen source.