Hi Ruby,
These phrases are synonymous. "im-" means "not" (it's a negative or privative force). So impossible means "not possible".
Realm is like "domain". So, if it's outside the realm or domain of possibility, then is it impossible.
You can use them interchangeably. I would say that "outside of the realm of possibility" gives more emphasis to the fact that it's impossible.