Yeah...well, maybe...probably not...no.
A compressor is all about controlling gain, not volume. There's input gain which is the signal coming from your bass and the input gain of the compressor...then the compressor does its compressing thang, effectively cutting the volume peaks (making you quieter)...then there's makeup gain, which is intended to make the volume coming out the same as the overall volume coming in...except your peaks are chopped so you sound louder and fuller.
Some comps have a significant makeup gain, but it is not a volume control. Can it be used as such? Probably, but as MODNY said, you won't have the control you're used to.