Is the surface integral of a vector field through the six surfaces of a cube zero when the vector field is defined in the whole region. If I integrate over all the surfaces for any vector field. The flux through opposite surfaces cancel out. So is this true for a cube?
This is not necessarily true for a cube (or for any closed surface).
If we imagine the vector field as measuring a velocity field of water in motion, then flux measures how much water is passing through the surface.
Now, if all your water is moving left to right, then you're right that the flux through the left face and the right face of a cube cancels out (and the flux through the remaining 4 walls is 0 because no water passes through them.)
But fluid flow can be vastly more complicated! In particular, if you have a source of water inside the solid, you can easily arrange for the net flux to be non-zero. (This is essentially amd's suggestion in the comments)
Now, water in real life is often (roughly) incompressable. If you assume this, as well as that there are no sources or sinks for water to emanate from or disappear into, then you have mathematically assumed the divergence of your vector field is zero. Then the divergence theorem tells you the net flux through the surface is 0, in this case. I think this is why your intuition was leading you to guess the net flux was zero.