Making foam with an automatic foam soap dispenser will be much simpler, requiring only liquid soap and water to be mixed. You can follow my post for more details.
Liquid soaps contain a very strict amount of preservatives which prevent bacteria from multiplying in the dispenser. When you open the dispenser and add tap water, you may be adding bacteria as well. Plus the extra water reduces the effectiveness of the preservatives, meaning the bacteria can multiply in the soap