I'm new to asymptotic operation so I need help to understand it. As I know $\mathcal{O(x)}$ is a set of functions. In Selberg's paper about elementary proof of prime number theorem there is that equation,
$$x\sum_{d\leq x}\frac{\mu(d)}{d}\log^2\frac{x}{d}+\mathcal{O}\left(\sum_{d\leq x}\log^2\frac{x}{d}\right)=x\sum_{d\leq x}\frac{\mu(d)}{d}\log^2\frac{x}{d}+\mathcal{O(x)}$$
What is happening when you get into left side? You can say that equation holds because $\mathcal{O(\sum_{d\leq x}\log^2\frac{x}{d}}) \in \mathcal{O(x)}$
is that the reason? $x$ is upper bound for $\log^2x$?