The Allies were able to fight a war on two fronts because they had much more manpower and manufacturing capability than the Axis had. Because of this, they (mostly the US) were able to fight on two fronts.
Think about the countries that made up the Allied powers. The Allies had both the USSR and the United States on their side. These were two countries with huge populations compared to that of Germany or Japan. In addition, the US had a huge manufacturing base that could not be damaged by enemy bombers the way the Japanese and German ones could be.
When you combine these two advantages, it explains why the Allies were able to fight on two fronts at once.