It would have been a very good idea for the western democracies to help the Spanish Republican forces in the 30's and prevent Franco's victory. That they did not was due, I think, primarily to their hostility toward socialism (the Spanish Republicans were socialists). The west was basically more anti-socialist than anti-fascist at that time, all things considered. After the main event (WWII) started, that situation changed radically.
Only Communist Russia made a serious national effort to help the Spanish Republicans, and their aid was outmatched by the German and Italian forces which assisted Franco.
The Luftwaffe gained valuable experience in Spain, which they later used to good effect in their blitzkrieg warfare.
I don't see much parallel between that situation and the one in Afghanistan, though...
The situation in Afghanistan is rather bizarre, in that the USA originally financed and helped establish the very Taliban fanatics whom they are presently attempting to dislodge and destroy. We all know that...but how does it compare to Spain in 1937? I don't much think it does.
I see one parallel, though. Spain sits in a very crucial spot, geographically...positioned at the gateway to the Mediterranean and the British base of Gibraltar. Hitler no doubt expected Franco to join the Axis forces in WWII, in which case the British would have had a hard time holding Gibraltar. If they had lost it, they would have lost the whole Mediterranean theatre.
Similarly, Afghanistan is in a very important spot, since it is the overland route to some vital oilfields in some very unstable little countries.
In the case of Spain, Franco was clever enough to avoid getting into an international conflict altogether, and his dictatorship survived.
In the case of the Taliban, they were not that clever...quite the contrary. It only remains to see if the West can exploit the strategic possibilities of Afghanistan without falling into a quagmire there. We shall see. The Russians tried and failed, but no superpower is helping the Taliban now, so the West may well succeed.