The foaming hand soap containers in question have a little disclaimer on them stating not to refill them with regular hand soap or they will clog. This is indeed true, however I've noticed a lot of people either throwing away the empty plastic container (what a waste!) or refilling it with regular hand soap, after which they just don't work.
The process is incredibly simple - the foaming pump works because it injects a bunch of air into a small amount of soap as it pumps. Most hand soap is too viscous to accept this air, and it just causes problems. Solution? Make a solution! Water down the soap!
Step 1: Choose a soap
Tip: Add the water slowly, so as to not agitate the soap too much - if it mixes while you're adding water, you will have a hard time getting it to fill without overflowing with suds everywhere.