The influenza virus has a very high mutation rate. This means that its surface proteins (antigens) will change. Since a vaccine contains a specific antigen, if the virus switches to a different antigen, then the vaccine will no longer be effective.
Furthermore, antibodies produced by the body would not be able to recognise, and bind with, the changed antigens.
Many viruses also damage the host's immune system. This means that, even if they received an effective vaccine, their body may not be able to produce sufficient antibodies to overcome the infection.