Even though Franziska is right, sometimes vaccination is also recommended in the case of an already suffered infection. For example, vaccination against Shingles (herpes zoster) is recommended even in indivduals who already had Shingles (and not only chickenpox). The rate and intensity of recurrences shall be lower after such a vaccination (see: http://www.cdc.gov/mmwr/preview/mmwrhtml/rr5705a1.htm).
Areli, that really depends on what the vaccine is. With live-attenuated or live-modified vaccines, there is always the potential of recombination and return to full virulence if a field strain comes along. Thats probably also why in some cases it will not be vaccinated once you have been infected already. However, if you have a dead or specific antigen only vaccine, it doesn't matter whether or not the host has been infected before. Here, the infection-vaccination can actually boost memory development/
There is effect, so called "original antigenic sin". When you immunize organism short time after disease, you can see significant loss of specific immune functions. Frequently, this effect takes place after immunization with pathogen similar to one, which initiated disease. Saving correction, this effect was firstly described for humoral immune response to influenza virus in ~1960s. Then, it was demonstrated in T cell mediated responses. In antiviral immune responses this effect is mediated by CD8 T cells producing IL-10 and TGFbeta.
If disease has already been occurred and individual acquired specific immunity to that particular disease then, when you give shot of same antigen(which is vaccine here) to the organism the immunity system will react fast (which may have some consequences, shock may be) and it will consider vaccine as antigen that's it.
for some disease like rabies and tetanus organism's body hasn't acquired immunity for long time therefore, each time organism expose to doubt full conditions doc. gives vaccine to boost up the immunity process. though it is very short and simple explanation I hope it will help you to clear basic idea.
High variability of certain bacteria and viruses makes practically required annual vaccinations (for example, vaccination against influenza is held every year, as each new season structure of the influenza virus changes).