The flu shot is not analogous to the development of drug resistant bacteria. In the latter scenario, what happens is an antibiotic kills some large proportion of the bacteria, such as 99.9999% but the 0.0001% that survive have managed to survive through some mutation that confers resistance to the medicine. Then, these survivors are all that's left and after a while they've multiplied into a sizeable population of their own. It's basically evolution in action. A vaccine just presents the body's immune system to parts of the virus so that it can form antibodies against those parts. Then when the person encounters the actual virus in the wild, their immune system already has a head start in fighting it.