yes it can work... if your medicine has a long half life. That
is if it stays in your body for a long time and is not remove.
Therefore when you take the drug, the medicine/cure is still
present to neutralize it and thus remove the toxic effects.
Another type is vaccine.. as we all already know.
You can also take medicine like tamiflu, when you know you are
gonna have flu (not applicable to h1n1) soon, so as to bring down
the effect of the flu. Taking of many other medications can also
help to prevent the illnesses from breaking out. These are called
prophylatic treatments..