Wikipedia says that the following statement is a vector identity:
$$\nabla \cdot (\mathbf{a} \mathbf{b}^\mathrm{T}) = \mathbf{b}(\nabla \cdot \mathbf{a})+(\mathbf{a}\cdot \nabla) \mathbf{b}$$
Where $\mathbf{a}\mathbf{b}^\mathrm{T}$ is the outer product of $\mathbf{a}$ and $\mathbf{b}$. Therefore, it is a matrix! Now my question is this:
How can we define the inner product of the operator $\nabla$ that is treated like a vector with a matrix!? Their dimensions don't match, so, the inner product in the classical sense is meaningless here.
$\nabla \cdot M$ is abuse of notation for the per-column divergence of $M$. Assuming $M$ has dimension $n\times n$ and your metric is Euclidean:
$$(\nabla \cdot M)_i = \sum_{j=1}^n \frac{\partial m_{ji}}{\partial x_j}.$$
The intuition here is that you can treat the nabla operator like a "vector" $\nabla = \left[\frac{\partial}{\partial x_1}\ldots \frac{\partial}{\partial x_n}\right]^T$ in which case the above formula is what you would get from applying ordinary rules of vector-matrix multiplication to the "inner product" $\nabla^T M$. This shortcut works since $\nabla$, like multiplication by a matrix, acts linearly, but of course one should be careful when relying on such notational tricks. Your identity is a great example; naive manipulation would not correctly recover the second term of the chain rule: $$(\nabla^T a b^T)^T \neq b (a^T \nabla) = b (\nabla \cdot a).$$