  The notion of $\mathcal{O}$-operator is a generalization of the Rota-Baxter
operator in the presence of a bimodule over an associative algebra. A
compatible $\mathcal{O}$-operator is a pair consisting of two
$\mathcal{O}$-operators satisfying a compatibility relation. A compatible
$\mathcal{O}$-operator algebra is an algebra together with a bimodule and a
compatible $\mathcal{O}$-operator. In this paper, we construct a graded Lie
algebra and an $L_\infty$-algebra that respectively characterize compatible
$\mathcal{O}$-operators and compatible $\mathcal{O}$-operator algebras as
Maurer-Cartan elements. Using these characterizations, we define cohomology of
these structures and as applications, we study formal deformations of
compatible $\mathcal{O}$-operators and compatible $\mathcal{O}$-operator
algebras. Finally, we consider a brief cohomological study of compatible
dendriform algebras and find their relationship with the cohomology of
compatible associative algebras and compatible $\mathcal{O}$-operators.
