I am comparing two approaches to linear regression.
Approach 1. (Fixed design) Sample $(x_1,Y_1),\dots,(x_n,Y_n)$ comes from linear model $$Y_i = x_i^T\beta + \varepsilon_i$$ where $\beta$ is unknown vector, $x_i$ are fixed known deterministic vectors, $\varepsilon_i$ are random variables with expectation $0$ and equal variance $\sigma^2$.
Approach 2. (Random design) Let $X$ be a random vector and $Y$ be a random variable with finite variance, such that $\mathbb E[Y|X]$ exists and equals $\mathbb E[Y|X] = X^T\beta$. Let $\varepsilon = Y-\mathbb E[Y|X]$. Then by the assumptions $\mathbb E[\varepsilon] = 0$ and let $\sigma^2 = \mathbb E[\varepsilon^2].$ Suppose $X$ and $\varepsilon$ are independent, this leads to model being homoscedastic $\mathrm{Var}(Y|X) = \sigma^2$.
Now if we take a random sample $(X_1,Y_1),\dots,(X_n,Y_n)$ from the distribution of $(X,Y)$, it can be shown that $$\mathbb E[Y_i|X_i] = X_i^T\beta$$ and $X_i$ and $\varepsilon_i = Y_i-X_i^T\beta$ are independent.
I have found several material/books/lecture notes saying that these two approaches are "equivalent". How I understood that is that if I am in approach 2 setting, I can treat everything as if I am in approach 1 setting since for every 'operation' in setting 1, there exists analogous 'operation' in setting 2. Am I correct, and if so is there a material that compares these two approaches more thoroughly?
These approaches are computationally "equal" if all the calculations (derivations) for the second approach, i.e., $\{(Y_i, X_i)\}_{i=1}^n$, are done by conditioning on $X=x$. Otherwise, they are different. For example, if the $X=x$ is set using randomization, then the regression coefficients bear causal interpretation. Otherwise, you need additional assumptions if you wan to perform causal inference.