Sure, you can let $\beta = x+2$.
There is nothing mathematically incorrect about letting another variable be equal to another variable/expression or substituted for it (though it can result in some nuances to be aware of, for example in integration/calculus). Sometimes it can even be more convenient - not so much in this case, but if you're dealing with larger, more complicated expressions, it can certainly make the work easier.
The key point would be to make sure it's clearly declared that $\beta = x+2$, though, or whatever you're substituting it for, so that there's no ambiguity with the reader.
EDIT: As noted in the comments, however, for this context specifically as $x$ is a variable, it is more appropriate to let $\beta$ be $\beta(x)$ in the above discussion. If there was no variable - for example, it was $\pi + 3$ where $\pi$ denotes the usual constant, you could just have $\beta$. Though in practice it's highly unlikely anyone will be confused either way.