Depends on the decoder and the CV that is meant to make the changes. That's if the decoder provides this feature.
What you are asking about should be described in some detail in the manual for the decoder you are using. It will be available on the manufacturer's site as a PDF file for downloading.
As others have already indicated, it's a matter of which sound decoder is in the locomotive, because some decoders don't have a CV that can be modified to support this.
None of the sound functions (CVs) are in the NMRA standards, either, so each sound decoder manufacturer is free to do whatever they choose. You therefore must have the technical reference manual for the specific decoder that is in the locomotive in order to determine what can and cannot be adjusted.