It is similar to "house" vs. "home". You can say "be at home" but not "be at house". The differences are:
- いえ: physical house vs. うち: includes the environment, family, returning place, as well as a physical house
- いえ: neutral about the owner of the house vs. うち: the speaker's own home by default.
Your conclusion is right, but I guess what your teacher means is that, sometimes, you can say things from the second or third person's perspective, and that makes it possible for the first person to say "うち" to refer to a non-first person's home. For example, "うちに帰りなさい" means "go home". And this means "one's own home", but the speaker can say this standing on the point of the view of the second person, meaning the second person's home.