Let $d:=\gcd(m,n)$
and
let $D:=\dfrac{mn}{d}=\text{lcd}(m,n)$;
notice that $m \mid D$ and $m \mid D$.
Then for every element $a=(b,c) \in \mathbb{Z}_n \bigoplus \mathbb{Z}_m$
we have:
$$
\underbrace{(b,c)+ (b,c) + ... + (b,c)}_{D\text{-times}}
=
D (b,c)= (Db,Dc) = (0,0)
;
$$
so every element of $ \ \ \mathbb{Z}_n \bigoplus \mathbb{Z}_m \ \ $ has order at most equal to $D:=\dfrac{mn}{d}=\text{lcd}(m,n)$.
On the otherhand we know that $ 1 \in \mathbb{Z}_{nm}$ has the order equal to $nm$.
Now suppose that
$\mathbb{Z}_n \bigoplus \mathbb{Z}_m$ and $\mathbb{Z}_{nm}$ are isomorphic;
then $\mathbb{Z}_n \bigoplus \mathbb{Z}_m$
must have an element of order $mn$;
but we know that the order of every element of $\mathbb{Z}_n \bigoplus \mathbb{Z}_m$ is less than or equal to
$$D:=\dfrac{mn}{d}=\text{lcd}(m,n) ; $$
which implies that $D=mn$; equivalently $d=1$.