Using dependent variable's and exogenous variables' lags as instruments in 2SLS Suppose we have the following structural equations:
$$y=\beta_0+\beta_1x+\beta_2z_z+\beta_3z_3+\epsilon,$$
where $x$ is the endogenous variable and $z_1,z_2$ are exogenous variables. In the literature, as well as in software packages (ivreg in STATA), I find that it is quite common to add dependent variable's as well as lagged exogenous variables as intruments in the first stage of 2SLS (to capture exogenous variation of the endogenous variable). In our case, we can consider $y_{t-1}, x_{t-1}, x_{t-k}$ as instruments for $x$. Is this legit and what is the rational behind this? Also, please provide some resources to read more about this. Thanks!
Is this legit and what is the rational behind this?

Yes you will find this even as a recommendation in many textbooks (e.g. see Romer Advanced Macroeconomics pp 376)  so it is legit although with a caveat.
A good instrument should be correlated with the endogenous variable and be able to through it exert an effect on dependent variable. Well lags are more often than not highly correlated with the contemporaneous observation of the same variable.
Next, instruments should not be correlated with residuals and for lags this will often hold (but not always) in economics.  This is because in many cases when the residual reflects new information learned by people between $t$ and $t-1$, economic theory simply often tells us that any variable that is known as of time $t − 1$ is uncorrelated with the residual.
However, this being said lagged instruments can still turn out to be weak, or violate some of the other assumptions of IV (for overview of all assumptions required for IV see for example Verbeek, a Guide to Modern Econometrics or Angrist &amp; Pischke Mostly Harmless Econometrics), and the above might not hold generally for any economic relationship. So these are no silver bullet, but they often do make sense in economics. Nonetheless, there is a criticism of their overuse in economics (see for example Wang &amp; Bellemare 2019). However, this is to my best understanding not because they would not be legitimate instruments but rather many practitioners just  apply them without even bothering to check if other conditions that good instrument should satisfy are actually really satisfied.