If we're talking about a pedalboard, a good general rule of thumb is at the beginning after the gate because it levels your performance before adding the distortion to prevent unwanted noises. If it's a mix, it varies, but typically somewhere around the beginning and the end. In a mix, not all guitars get compression, but if it's an excessively dynamic performance it's usually good adding it after the EQ to consolidate the tone, if you want to shape or improve dynamics, it's better at the end because that way you don't change the tone.