So for $M_n(D)$ to be a prime ring it means that if $A$,$B$ are ideals of $M_n(D)$ and $AB=0$ then either $A=0$ or $B=0$.
The fact that $D$ is an integral domain seems quite crucial, because this means that if $a,b \in D$ and $ab=0$ then either $a=0$ or $b=0$.
Anyway, lets let $A,B$ be ideals of $D$ s.t. $AB=0$.
$AB = \{ab : a \in A, b \in B\}$
I have also deduced that if $A$ is an ideal of $M_n(D)$, then $A$ is of the form $M_n(I)$ where $I$ is an ideal of $D$.
I'm gonna need some advice from this point.. Thanks everyone!
Let's prove the contrapositive: if $A \ne 0$ and $B \ne 0$, then $AB \ne 0$.
Using your fact, let $A = M_n(I)$ and $B = M_n(J)$ for some ideals $I,J$ of $D$. If $A \ne 0$ and $B \ne 0$, then there are nonzero elements $x \in I$ and $y \in J$, so that $x\mathbf{1} \in A$ and $y\mathbf{1} \in B$, where $\mathbf{1}$ is the identity matrix (so $x\mathbf{1}$ is the matrix with $x$ on the diagonal and $0$ elsewhere). Then $xy\mathbf{1} = (x\mathbf{1})(y\mathbf{1}) \in AB$ is nonzero since $D$ is an integral domain.