First off, welcome. Great community here that is happy to debate stuff and also disagree sometimes, which is very refreshing.
Second, yeah, you can definitely swap out an indoor ride for an outdoor ride. Many, many good ways to approach this.
personally i find that my mtb rides tend to be pretty strenuous. something about it that i end up trying to go fast and push it, whatever the terrain. So as a result, when i swap out a training session in favor of an MTB ride, i usually swap out a more taxing workout.