Other posters have pretty much hit upon the solution. If the enemy Wizard doesn't know where the Fighter is, he can't teleport next to him.
To solve this, the Wizard will either Scry or Discern Location, or possibly Discern Location then Clairvoyance if Discern isn't enough information for a Teleport.
If the fighter is immune to the divinations, or uses protective measures like a Screen or False Vision spell, then the Wizard will simply fail to show up at his door.
In a world like D&D's, the only way to ensure that powerful enemies don't get the drop on you is to A) Be somewhere that is inaccessible by any means (Mord's Mansion, Rod of Security) or B) Not let your enemies know where you are.
To solve this, the Wizard will either Scry or Discern Location, or possibly Discern Location then Clairvoyance if Discern isn't enough information for a Teleport.
If the fighter is immune to the divinations, or uses protective measures like a Screen or False Vision spell, then the Wizard will simply fail to show up at his door.
In a world like D&D's, the only way to ensure that powerful enemies don't get the drop on you is to A) Be somewhere that is inaccessible by any means (Mord's Mansion, Rod of Security) or B) Not let your enemies know where you are.