That would really depend on the aircraft and the nature of the cargo compartment. Some are acccessable in flight, some are not. The cargo compartment is classified according to it's firefighting requirements and capabilities, in flight. Compartments which can do not require crewmember for direct access in flight, such as those having their own extinguishing capability, may not have direct access.
What you see on the movies, where a crewmember or secret agent crawls around the airplane in all sorts of hidden spaces and passageways, isn't possible in most airplanes.