Yes, nothing in the rules about casting defensively makes any mention of particular threats. It doesn’t state that the option eliminates the threat from any particular creature, but rather states that it prevents the casting from provoking an attack of opportunity in the first place.
A sufficiently-paranoid spellcaster will thus always cast defensively, at least once above the lowest levels (there, the risk of failing the Concentration check and losing the spell means casting defensively is not always best, but in short order a spellcaster will have 100% success with it). At my tables, it is generally assumed that any spell that can be cast defensively with a 100% chance of success on the Concentration check will be cast defensively. If you want to actually threaten spellcasters with attacks of opportunity, take the Mage Slayer feat from Complete Arcane (or Miniatures Handbook or Monster Manual V).