Couple reasons:
1) We use a different virus to effect smallpox immunity. We lucked out that cowpox, which doesn't proliferate in humans, induces an immunological response that results in smallpox immunity. Pure luck, otherwise we would have no defense against smallpox. Unfortunately, vaccinations are no longer common, and the virus may be re-emerging as a biological threat.
2) Smallpox is a DNA virus, and is less subject to errors in replication. Flu is an RNA virus, and the RNA transcribing machinery has less fidelity. So the virus produces tons of mutants during an infection, many are ineffective. Mutants make vaccine development more difficult. DNA viruses on the otherhand are incredibly robust, and in themselves are hard targets because their replication machinery cannot be targeted without fear of monkeywrenching the cell's own machinery.