Yes, a closed system can have a change in volume, so can do work. However, it can't exchange matter with the surroundings which you said before. Think of a container with a piston in it-- this is a closed system because there isn't any exchange of matter with the surroundings, but you can pull up or push down on the piston and change the volume (and therefore do work).