My book is An Introduction to Manifolds by Loring W. Tu.
Corollary 8.7 is (smooth) invariance of dimension, and Theorem 22.3 is smooth invariance of domain.
I view these as converses and think of combining these two together to say
Let $U$ be an open subset of $\mathbb R^n$. Let $S$ be a subset of $\mathbb R^m$. Let $U$ be diffeomorphic to $S$. Then $m=n$ if and only if $S$ is open in $\mathbb R^m$. $\tag{1}$
By generalizing Corollary 8.7 based on Corollary 8.6 to get
Let $U$ be an open subset of a smooth $n$-manifold $N$. Let $S$ be a subset of a smooth $m$-manifold $M$. Let $U$ be diffeomorphic to $S$. Then $m=n$ if $S$ is open in $M$. $\tag{2}$
I think I can generalize $(1)$ based on Remark 22.5 to get
Let $U$ be an open subset of a smooth $n$-manifold $N$. Let $S$ be a subset of a smooth $m$-manifold $M$. Let $U$ be diffeomorphic to $S$. Then $m=n$ if and only if $S$ is open in $M$. $\tag{3}$
Are these correct?