As mentioned in the comments, we need to fix isomorphisms $\newcommand{\D}{\mathscr{D}}\D_1 \xrightarrow{\sim} \D_1^{op}$ and $\D_2 \xrightarrow{\sim} \D_2^{op}$ for the question to make sense. They key point is that in this case, there is a canonical isomorphism $\D_1^{op} \otimes \D_2 \xrightarrow{\sim} \D_2^{op} \otimes \D_1$, inducing equivalences between the categories of $\D_1$-$\D_2$-bimodules and $\D_2$-$\D_1$-bimodules.
Hence one can consider the gluings $\D = \D_1 \times_\varphi \D_2$ and $\D' = \D_2 \times_\psi \D_1$, where $\psi$ is the $\D_2$-$\D_1$-bimodule corresponding to $\varphi$.
Indeed one has a functor $\D \to \D'$ as you described, where $\mu^{op}$ means the element of $\psi^0(M_1, M_2)$ corresponding to $\mu \in \varphi^0(M_2, M_1)$ under the isomorphisms induced by duality. Further this functor $\D \to \D'$ is clearly an equivalence, swapping the first two components and acting by duality on the third.