How to perform linear regression on clusters of data Suppose I have 2 clusters of data: $\{(Y_{1i}, X_{1i})\}_{i=1}^{n_1}$ and $\{(Y_{2i}, X_{2i})\}_{i=1}^{n_2}$, and I'm interested in running a simple linear regression on each cluster.
I assume that
$$Y_{1i} = \beta_{10} + \beta_{11}X_{1i}+\epsilon_{1i}$$
$$Y_{2i} = \beta_{20} + \beta_{21}X_{2i}+\epsilon_{2i},$$
where $\epsilon_{1i}, \epsilon_{2i}$ have mean 0 given $X$. To estimate the intercept and slope coefficients, I can minimize the empirical squared error in the two clusters separately:
$$argmin_{\beta_{10}, \beta_{11}} \frac{1}{n_1}\sum_{i=1}^{n_1}(Y_{1i} - \beta_{10}-\beta_{11}X_{1i})^2$$
$$argmin_{\beta_{20}, \beta_{21}} \frac{1}{n_2}\sum_{i=1}^{n_2}(Y_{2i} - \beta_{20}-\beta_{21}X_{2i})^2$$
Now suppose I assume that the intercept and slope coefficients are identical between the two clusters, i.e.,  $\beta_{10} = \beta_{20} = \beta_0$ and $\beta_{11} = \beta_{21} = \beta_1$. Is this equivalent to running a single linear regression model on the pooled data? i.e., I would minimize:
$$argmin_{\beta_{0}, \beta_{1}} \frac{1}{n_1 + n_2}\sum_{i=1}^{n_1 + n_2}(Y_{i} - \beta_{0}-\beta_{1}X_{i})^2$$

Short answer: yes.*
The first model you describe is a "no pooling" model where coefficients are treated independently. The second is a "complete pooling" model. [1]
You can rewrite the no-pooling model with a single expression: $\hat{y}_i = \mathbb{1}[c=1](\beta_{10} + \beta_{11} x_i) + \mathbb{1}[c=2](\beta_{20} + \beta_{21} x_i)$. [2]
Fixing the no-pooling betas to be equal, $\hat{y}_i = \mathbb{1}[c=1](\beta_0 + \beta_1 x_i) + \mathbb{1}[c=2](\beta_0 + \beta_1 x_i)$, which reduces to just $\hat{y}_i = \beta_0 + \beta_1 x_i$. [3]
* Edit: As other commenters have pointed out, your pooled model also implicitly assumes homoscedasticity. I read that as an accidental omission in your description, but without that assumption, your pooled model expression is indeed no longer correct.

[1] There are also "partial pooling" models that jointly estimate shared and independent terms for different data groupings / "clusters". While you haven't asked about that explicitly, partial pooling might be interesting for you to look into for your problem.
[2] In case you're not familiar, $\mathbb{1}$ is the indicator function. In the notation I'm using, $\mathbb{1}[c=1]$ is 1 when $c=1$ and $0$ otherwise.
[3] You can also see from writing the models out like this that there are further options: for example, you can allow any combination of the intercept, the slope, and the error term variance to vary with group.
