In physics derivations, we often tend to be a little careless about distinguishing between small finite things and the limit as those things go to 0. But essentially the first one is using the definition of derivative.
Suppose instead of ##dx## you use ##h##.
Define ##f(x) = \rho v_x##.
Then ##\left. -(\rho v_x) \right |_{x-dx/2} = f(x - (h/2))## and ##\left. -(\rho v_x) \right |_{x+dx/2} = f(x + (h/2))## and the left hand side of that equation becomes ##f(x + (h/2)) - f(x - (h/2))##.
We know that in the limit as ##h \rightarrow 0##, ##\frac {f(x + (h/2)) - f(x - (h/2))} {h} \rightarrow \frac {\partial f}{\partial x}## which is being rearranged as
##f(x + (h/2)) - f(x - (h/2)) = h \frac {\partial f}{\partial x}##
where ##h## is the infinitesimal ##dx##.
It is as I said not exactly rigorous mathematics.
As for your second question, you can not transform the left into the right. That's not a statement that the two quantities are equal in all cases. It's a restatement of some earlier differential equation. The left is the divergence of ##\rho \vec v## and the right is the time derivative of ##\rho##. There must be some other equation that says that those two things are equal for ##\rho##.