Correct. If you take a totally clean, disinfected nail, stick it in some lab grade brine until it gets rusty, and then stab yourself with it, there is a 0% chance of getting tetanus.
You could technically have tetanus on something without it being covered in dirt. My point is tetanus bacteria lives in the dirt. But the rust has nothing to do with it other than making the metal more likely to cut or pierce you.
People tend to think the rust is what causes it.
Fun fact: tetanus comes from dirt, not rust. But it has to get into your blood and typically that only happens when you get pierced by a piece of dirty metal, which will typically be rusty if it's in that situation.