I read that the only possible homomorphism from $\mathbb{Z}_7$ to $\mathbb{Z}_{12}$ is the one mapping all elements of $\mathbb{Z}_7$ to $\{0\}$. Since if there is another homomorphism from $\mathbb{Z}_7$ to $\mathbb{Z}_{12}$, it must be able to map any non-trivial subgroup of $\mathbb{Z}_7$, to a subgroup of $\mathbb{Z}_{12}$. However, this means that $\mathbb{Z}_{12}$ would have a subgroup of order $7$, which is impossible.
I guess what is implied in the above statement is that homomorphisms preserve the order of subgroups ... but is this true in general ?
It is not true in general. Let $f: \mathbb Z_6 \to \mathbb Z_6$ given by $f(x)=2x$. The map $f$ is clearly a homomorphism but it does not preserve the order of the group itself.
I think this statement means, since only subgroups of $\mathbb Z_7$ are $\{0\}$ and the group itself, kernel of any non-trivial homomorphism is $\{0\}$ and so any non-trivial homomorphism is injective. This means $\mathbb Z_7$ is isomorphic to image of itself but this cannot happen since image of a homomorphism is a subgroup of $\mathbb Z_{12}$ and this group does not have a subgroup of order $7$.