After the USSR invaded Afghanistan, a stuffton of surplus arms and munitions ended up there. It happens every time there's a war in a far-off country, stuff gets left behind. Besides, the police and army of middle-eastern countries will sometimes sell their weapons and ammunition for a little extra money.
Besides, not many people actually own true-blood AK-47s, they're mostly just garage reproductions or chinese Type-56s (developed when the USSR switched over to the AKM in 1956).
The afghanistanis don't really liked being walked all over by NATO, insurgency is bound to happen when NATO forces keep stirring things up.
The AK47 gained fame and was used by the USSR due to the fact that it was DURABLE and easy to operate. If it truly jammed a lot and broke down frequently it wouldn't be in use at all because it's a drain of money.
(The Korobov TKB-517 was actually cheaper to produce and more reliable than the AK-47, yet the design was turned down because the Red Army was more familiar with the AK. Derp USSR.)
Also what's all this nonsense about surplus 7.62x39mm being awful, it's copper-washed steel cases and lacquered bullets, it's not going to cause stoppages more frequently than expensive PRVI rounds with brass cases. The priming substance is corrosive and will leave salts in the bore which will encourage rusting if you don't clean them out, but you should clean your rifle after firing it anyway.