The issue is the governments like Nigeria are completely incapable of regulating what goes on inside of its borders. In cases like Nigeria, where the "419" scam is actually an measurably significant industry within the country, the scammers are probably in cahoots with the authorities.
Why does e-commerce work in the US? As a guy sitting in New York, how can I comfortably sell goods via the internet to someone in Hawaii or New Mexico? Fundamentally, it's because the US is a nation governed by law, and efforts to defraud are not acceptable.