For what conditions on $A$, $B$ and $C$ (square matrices of size $n$) would there be a unique solution to $$ ABX + AXC + XBC = D, $$ for any $D$? Can one expect a characterization similar to the Sylvester Theorem, which states that there always exists a unique solution to $AX + XB = C$, for any $C$, if and only if $A$ and $B$ do not share an eigenvalue? And then, can this be extended to equations of the form $ABCX + ABXD + AXCD + XBCD = E$, and beyond?

7$\begingroup$ I didn't even know Sylvester was in the Army, much less that he held the rank of a General. $\endgroup$ – Gerry Myerson Jan 26 at 3:57

1$\begingroup$ @Gerry Myerson may be he meant the concept of generalization in mathematics. $\endgroup$ – Ahmad Jamil Ahmad Masad Jan 26 at 6:48

1$\begingroup$ @GerryMyerson: of course, he was: en.wikipedia.org/wiki/John_B._Sylvester $\endgroup$ – M.G. Jan 26 at 11:50

1$\begingroup$ @AhmadJamilAhmadMasad: no need to apologize, it was a joke :) The general is a different Sylvester. Or is he?... $\endgroup$ – M.G. Jan 26 at 12:14

2$\begingroup$ @GerryMyerson. I heard this joke 20 years ago, from Efimov, à propos of his proof of the General Burnside conjecture. $\endgroup$ – Denis Serre Jan 26 at 14:35
Can one expect a characterization similar to the Sylvester Theorem
As far as I know, no, apart from very special cases where the coefficients can be triangularized simultaneously. There is a big gap in difficulty between the 2term case (where there is a canonical form for pairs of matrices, an $O(n^3)$ algorithm, etc.) and the 3term case, when there is basically nothing apart from turning it into a $n^2 \times n^2$ linear system.
Even in your case where your coefficients have a special form no particular simplifications spring to mind. As far as I know, a nice characterization is an unsolved (and very likely unsolvable) problem.

1$\begingroup$ Maybe a more definite negative answer (for fixed $n\ge 2$) would be to show that the characterization does not only depend on the conjugacy classes of $A$, $B$, and $C$. $\endgroup$ – YCor Jan 26 at 8:20