Since the free power exchanges happen at any time, can they be done in response to gaining power?
For example, I'm sitting pretty on 0-0-10. If something is built near my Trading House, could I quickly convert 1 power to 1 coin and then take the 2 power from the Trading House to get back to 0-0-10? Is that legal?
Actually the power exchanges can't happen at any time. They can only happen at any time
on your turn (see page 13 of the rules).
Your trading house example isn't legal because it's not your turn when you could gain the power. Do note that you can exchange power before you pass, because passing is considered an action that you take on your turn.