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 slope 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}\)