Gauss's law states that the electric flux through any closed surface is
equal to the charge enclosed by the permittivity. It applies to any
charge distribution and any closed surface.
the surface that we choose for the application of guass`s law is called the gaussian surface.you may choose any guassian surface and apply guass`s law.however ,take care not to let the guassian surface pass through the discrete charge.this is because electric field due to a system of discrete charges is not well defined at the location of any charge.the gaussian surface can pass through a continuous charge distribution