Correct. The definition of "threatened square" i posted, clarifies that the dangerous action must be performed by an enemy (please see emphasis).
... but following your reasoning, lets assume you're playing a cleric and have just cast, say, a "Bless" spell during your turn in the round. All your allies within 50ft gain the benefits. Cool!
Suddenly the party archer, next to you, aims his shot at a foe and his dangerous action provokes the AoO from you.
Will he be denied the bonuses granted by the "Bless" spell?... He's either an ally or an enemy. As Captnq mentioned, when do you get to choose your enemies and allies during the encounter? Is it valid to choose different allies/enemies during the same encounter as a player sees fit?
This reminds me of another, weird, thing that could happen...
Flanking doesn't mention friend or foe, but rather uses "threatened squares" rule... Well... Could i say that i consider the enemy behind the front line foe as, in fact, an ally, so that i get flanking bonuses?
This and other questions can be raised, that's why i try to keep it simple in my games... but if your DM allows it, i'm cool with that.