When is the tensor product of rings of integers again a ring of integers?

I cannot recall right now the details, but it should be the case, that your conditions $K$, $L$ linearly disjoint and$$\text{gcd}(\Delta_K, \Delta_L) = 1$$are necessary and sufficient for$$\mathcal{O}_K\otimes \mathcal{O}_L\cong \mathcal{O}_M.$$I guess you have already figured out the sufficiency. To go the other way, you get quite quickly by tensoring with $\mathbb{Q}$ that if$$\mathcal{O}_K\otimes \mathcal{O}_L\cong \mathcal{O}_M,$$then $M$ has to be the compositum of $K$ and $L$ and, by counting dimensions, that they have to be disjoint. For the remaining part, you would like to show that if the discriminants are not coprime, then $\mathcal{O}_K\otimes \mathcal{O}_L$ cannot be integrally closed, and hence, cannot be isomorphic to $\mathcal{O}_M$. Because these are rings of dimension $1$, this is the same as showing that they are not regular. For this, it should suffices to first tensor with $\mathbb{Z}_p$ (the completion of $\mathbb{Z}$ at $p$) for a prime $p$ dividing both discriminants, and then show that this is not regular. (This will involve some kind of commutative algebra lemma, which I cannot recall.)

We get$$(\mathcal{O}_K\otimes \mathcal{O}_L)\otimes \mathbb{Z}_p=(\mathcal{O}_K\otimes \mathbb{Z}_p) \otimes_{\mathbb{Z}_p} ( \mathcal{O}_L \otimes \mathbb{Z}_p).$$But now, $\mathcal{O}_K\otimes \mathbb{Z}_p$ splits up into $$\prod_i \mathcal{O}_{K, m_i},$$where $m_i$ are the primes in $\mathcal{O}_K$ dividing $p$, and the same for $\mathcal{O}_L$. ($\mathcal{O}_{K,m}$ denotes the completion of $\mathcal{O}_K$ at $m$.)

Thus, we are examining a product of rings of the form $$\mathcal{O}_{K,m} \otimes_{\mathbb{Z}_p} \mathcal{O}_{L,n}.$$ We just need to show one of these is not regular. For this, you take $m$ and $n$ that are both ramified, and it should be relatively straightforward algebra to show this.

If you are not familiar with regularity, look up some book on commutative algebra.