According to Gauss theorem, the electric flux through a closed surface depends only on the net charge enclosed by the surface and not upon the shape or size of the surface.
For any closed arbitrary shape of the surface enclosing a charge the outward flux is the same as that due to a spherical Gaussian surface enclosing the same charge.
Justification: This is due to the fact that
(i) Electric field is radial and
(ii) The electric field E ∝ \(\cfrac1{R^2}\)
Thus, electric field at each point inside a charged thin spherical shell is zero.