The CSM was always able to be depressurized, since the contingency procedure for getting back from the LM to the CSM, in case the docking mechanism would fail to latch or the doors were unable to open, was to go around via the outside (i.e. open the LM hatch and CM hatch and transfer via an EVA):
An Apollo contingency transfer is required if the lunar module (LM) cannot be docked to the command module (CM) after lunar-orbit rendezvous.
(from APOLLO CREW PROCEDURES, SIMULATION, AND FLIGHT PLANNING)
(The extravehicular transfer is contingency procedure 5.3.14 in the Apollo Operations Handbook (pdf) in case IVT (intravehicular transfer) is not possible)
The depressurization was via a valve that just vented to outside:
The main, or side hatch has a depressurisation valve built into it. It is operated by releasing a handle and winding the valve open.
(from Apollo 15 Flight Journal)
To open the hatch, the cabin must be completely depressurized by opening a cabin relief and dump valve on the hatch.
(from Apollo Lunar Module Quick Reference Data)