The electric flux through an area is defined as the electric field multiplied by the area of the surface projected in a plane perpendicular to the field. Gauss’s Law is a general law applying to any closed surface. It is an important tool since it permits the assessment of the amount of enclosed charge by mapping the field on a surface outside the charge distribution. For geometries of sufficient symmetry, it simplifies the calculation of the electric field.
Another way of visualizing this is to consider a probe of area A which can measure the electric field perpendicular to that area. If it picks any closed surface and steps over that surface, measuring the perpendicular field times its area, it will obtain a measure of the net electric charge within the surface, no matter how that internal charge is configured.