If either the opponent or the permanent you control becomes an illegal target by the time Iroh's second ability resolves, the ability does nothing and you cannot choose to have the opponent gain control of the permanent.