Alright so I did some minor investigating into onions and phosphoric acid. As it turns out these claims are bogus.
Firstly thinking that putting onions on your feet would purify your blood is just simply impossible as the liver and kidneys handle that. More so Phosphoric acid is more of a irritant than anything else its commonly found in soft drinks, in the link found here you can find a compound summary for phosphoric acid from pubchem, and if your interested you can find many more possible uses of phosphoric acid at [wikipedia].2
More so if Phosphoric acid is found commonly in soda then drinking soda should help purify our blood which is clearly not the case.
Now for the second claim I've found a link here that targets it pretty well.
The relevant portion.
Dr. MacDonald: No, onions do not absorb bacteria. The idea that a vegetable would attract and suck into itself bacteria from the air is not even logical. The onion may turn black because it would eventually rot from both cell breakdown events and bacterial contamination if you left it out, not because it absorbs germs. Onions and garlic are slightly acidic, which could have antibacterial effects if you rubbed the juice on things, but these are much less effective than bleach or chemical antibiotics. Eating these vegetables provides antioxidants that can have health benefits, but they are unlikely to prevent or cure disease.
While Dr. MacDonald is talking about onions sucking the bacteria out of the air, the point is still the same Onions would at best have a minor antibacterial affects at best, and even then only if you rubbed the acids on yourself, and in which case there are far better antibacterial agents. On the other hand though eating onions and garlic does actually have health benefits that can strengths your immune system to help resist or prevent illness.
To conclude sleeping with onions touching your feet or anywhere else for that matter isn't going to do much, although eating them will give you some health benefits.