The equation for magnitude of the electric field from a single infinite sheet of charge is not the one you gave, it is
$$E=\frac{\sigma}{2\epsilon_o}$$
Then the field between two infinite parallel sheets of charge is
$$E=\frac{\sigma}{\epsilon_o}$$
But the same was directly applied for the parallel plate capacitors
and capacitors are made of plates of finite length. How is it that the
relation holds?
The second equation holds for a parallel plate capacitor of finite dimensions provided that the distance $d$ between the plates is much less than the dimensions of the plates. Then the field is uniform except at the ends of the plate (edge effect). So the dimensions of the plates, in actuality, don't have to be "infinite", just very large compared to the plate separation.
Then for the capacitor we have a uniform field of magnitude $E$ that is related to the plate separation $d$ and the voltage $V$ across the plates by
$$E=\frac{V}{d}$$
Hope this helps.