As others have pointed out, the one-way property of membership ($\in$) is, in reality, more appropriate than the implicit, or rather explicit, two-way property of equality ($=$), as it is customarily used in all other mathematical contexts. The entire point of the question is to determine which is correct, not which is currently in use.
Also as others have pointed out, there may be cases where it is inconvenient to combine function notations with $\mathcal{O}()$ notations, such as:
$$x^3 + \mathcal{O}(x) = \mathcal{O}(x^3)$$
In this case, here is what I would do:
$$\{x^3\} \cup \mathcal{O}(x) \subseteq \mathcal{O}(x^3)$$
This maintains theoretical rigor, which is important, while mirroring the syntax of intuitive usages:
$$x^3 + x = \mathcal{O}(x^3)$$
I would also point out that, contrary to the complaints of some answers, using $\mathcal{O}(x^3)$ is not really an abuse of function notation, as "the cube of $x$" is a function on $x$. One could write out $y = x^3$ but that would introduce ambiguity as to whether we are solving for $y$ or $x$. In the same way, you wouldn't write out $\mathcal{O}(g(x) = x^3)$, and if you don't need to use $g$ otherwise, it is simpler and easier to understand $\mathcal{O}(x^3)$.