Once inside the body, the bacteria start to multiply and establish an infection. C. tetani produces two exotoxins, tetanolysin and tetanospasmin. We don't really know what tetanolysin does, but tetanospasmin is a neurotoxin and is super lethal. Once inside you, it travels through your blood vessels and lymphatics, where it gains access to certain parts of the nervous system: peripheral nerve terminals (nerve endings found all over the body), the spinal cord, and the brain. The toxin is absorbed by the nerve axon and transported across synaptic junctions until it reaches the central nervous system, where it attaches to gangliosides (certain proteins that serve in cell signaling) at the ends of inhibitory motor nerve endings. Here, the toxin cleaves other proteins that are involved in nerve signaling, and thus prevents any electrical movement between synapses.
So now you know how tetanus is caused. What does the vaccine do?
Just FYI, there is another tetanus shot you can get which, technically speaking, is not a vaccine. It is tetanus immunoglobulin, and is essentially the serum from someone else who has antibodies against tetanus. Injecting yourself with this will give you temporary immunity in case you might have just been infected. This is called passive immunization because unlike active immunization (what is described above) the body doesn't produce its own antibodies.
Now, you know how the vaccine (and vaccines in general) work. So, now we can ask:
What happens if you get a tetanus shot with a rusty needle? (Assuming that: you have no prior immunity to tetanus and you are receiving the tetanus vaccine, not the immunoglobulins)
Essentially, we are asking: what happens if you get hit with the tetanoplasmin producing bacteria and the the weakened form of the tetanoplasmin toxin at the same time? The short answer is: you will still get sick.
This is because when you administer a vaccine, you need to give your immune system enough time to develop the antibodies via B lymphocytes, the cells that make the antibodies. B and T lymphocytes are part of your body's adaptive immune system, which typically kicks in 6-7 days after the innate immune system (which acts immediately upon invasion by pathogens). By the time a B cell recognizes the antigen, replicates, and creates antibodies to the weakened form of the tetanoplasmin, the bacteria from the rusty needle could have proliferated and produced enough toxin to cause damage.
So there you have it. Don't get a shot with a rusty needle, even if it's a tetanus shot :)
Thanks for reading