Closed loop is a contour. You can you calculate the flux through a contour ?
I guess you meant, a closed surface which encloses a volume.
In that is the case, the net flux must be zero.
From Gauss' law, the next flux through a closed surface is,
Now, the net charge of a dipole contain charges
Thus, for n dipoles, the net charge is zero as well.
Thus, the net charge enclosed by the surface is zero.
Thus, by Gauss' law,