I've two table EMP & DEPT. Below are the descriptions.
SELECT * FROM EMP WHERE EMP_ID IN (SELECT SAL FROM DEPT);
This is because Oracle supports correlated subqueries one level deep. So the scope of the columns in the outer query includes the subquery in your example.
The query you wrote is equivalent to:
SELECT * FROM EMP WHERE EMP_ID IN (SELECT EMP.SAL FROM DEPT);
It also highlights the need to adequately alias your queries - if you had written:
SELECT * FROM EMP WHERE EMP_ID IN (SELECT DEPT.SAL FROM DEPT);
then you would have gotten the error you were expecting.