can a ring homomorphism map an integral domain to a non integral domain?
Given any unital ring $R$ (with multiplicative identity $1_R$, say), there is a unique ring homomorphism $\Bbb Z\to R$ (take $1\mapsto 1_R$ and "fill in the blanks" from there).
This may be an injective map, even if $R$ has zero divisors. For example, take $$R=\Bbb Z[\epsilon]:=\Bbb Z[x]/\langle x^2\rangle.$$ Surjective examples are easy to come by. You are of course correct that such maps cannot be bijective if $R$ has zero divisors.
The quotient map $f: \mathbb{Z} \to \mathbb{Z}/(4)$ maps an integral domain $\mathbb{Z}$ to a ring with a (nilpotent) zerodivisor $\mathbb{Z}/(4)$. Now, the quotient map $g: \mathbb{Z}/(4) \to (\mathbb{Z}/(4))/(2) = \mathbb{Z}/(2)$ maps this ring to the field $\mathbb{Z}/(2)$.
Consider the map \begin{align*} \phi : k&\hookrightarrow k[X,Y]/(XY)\\ a&\mapsto a + (XY), \end{align*} where $k$ is a field. This is the inclusion of $k$ into a quotient of the polynomial ring over $k$ in two variables. We see that this is a ring homomorphism, as $$\phi(ab) = (ab + (XY)) = (a + (XY))(b + (XY)) = \phi(a)\phi(b).$$ So we have an injection of a field (not just an integral domain, and not just a homomorphism) into a commutative ring with zero divisors: $$(X + (XY))(Y + (XY)) = XY + (XY) = 0 + (XY) = (XY).$$ Like xyzzyx said in his answer, you can also find a surjective map from an integral domain to a commutative ring with zero divisors (eg. $\pi : \Bbb{Z}\twoheadrightarrow\Bbb{Z}/n\Bbb{Z}$, where $n$ is composite), so we can indeed find injective or surjective maps from an integral domain to a ring with zero divisors.