For any positive integer $n$, let $\mathrm{PF}(n)$ denote the set of all distinct prime factors of $n$ (not counted with multiplicity).
The question (using the above notation) is: Is it true that for any two positive integers $m$ and $n$, $\phi(mn)=m\phi(n)$ if and only if $\mathrm{PF}(m) \subseteq \mathrm{PF}(n)$, where $\phi$ is the totient function?
Hint for the if direction: Any prime factor of $mn$ must either be a prime factor of $m$ or a prime factor of $n$ (by Euclid's lemma). But since any prime dividing $m$ also divides $n$, $mn$ has the same distinct prime factors as $n$, and hence any integer coprime to one of them is also coprime to the other.
Note that it is possible for $\mathrm{PF}(m) \subseteq \mathrm{PF}(n)$ to be true while $m \not\mid n$. For example, $4 \not\mid 2$, but they both have $2$ as the only prime factor. In this case, $\phi(8)=4=4 \cdot 1=4\phi(2)$.
$$ \varphi(mn)=mn\prod_{p\mid mn}\left(1-\frac{1}{p}\right) \quad \text{ and }\quad m\varphi(n)=mn\prod_{p\mid n}\left(1-\frac{1}{p}\right). $$ Therefore they are equal if and only if "$p\mid m$ implies $p\mid n$", i.e., $PF(m) \subseteq PF(n)$.