Casella and Berger exercise 2.15 asks to prove ($Y$ and $X$ are any random variables): $E[\max(X,Y)] = E[X] + E[Y] - E[\min(X,Y)]$, in the solution it gives:
Assume without loss of generality that $X \le Y$. Then $\max(X, Y) = Y$ and $\min(X, Y) = X$. Thus $X + Y = \max(X, Y) + \min(X, Y)$. Taking expectations $E[X + Y] = E[\max(X,Y) + \min(X,Y)] = E[\max(X,Y)] + E[\min(X,Y)]$. Therefore $E[\max(X,Y)] = E[X] + E[Y] − E[\min(X, Y)]$.
How shall I think of $X \le Y$ "without loss of generality". Is this stochastic dominance (but then I would not think we can assume it without loss of generality)? Or does it mean something else?
You are correct that it is weird to assume $X \le Y$ or $X \ge Y$ for random variables; either one would be a massive loss of generality!
The solution is not careful about separating two steps of this argument.
In many problems, it is possible to combine these two steps, but in this case, it makes the "without loss of generality" weird, and we should keep the two steps separate.
Another way to make things "specific enough" to make the assumption is to talk about specific outcomes in the sample space. We can say:
The notation with $\omega$ is cumbersome and we'd often prefer to omit it. One way or the other, we should make it clear that in the "without loss of generality" statement, we are comparing $X$ and $Y$ at some specific outcome, not in general.