this is only fine when there is no parallel output from the d.i to go to the mixer. some d.i boxes have parallel output that splits the signal to the amp and mixer; this is a handy way to record bass as well. yet, there is a lot of ways to record where there is no right way but only guidelines.
an active d.i with controls on eqs, drive, etc... can also be use as a pre-amp. it's a matter of personal taste.
d.i. boxes have balanced XLR output (mic level) to send audio signal to the mixer and unbalanced 1/4" phone jack parallel output (line level) to send signal to other equipment such as an instrument amp.
many bass amps, acoustic guitar amps and keyboard amps nowadays don't need a separate d.i. box because they already have XLR output (mic level) built-in to send audio signal direct to the mixer. most of these instrument amps also have 1/4" phone jack "effects send" output (line level) and 1/4" phone jack "speaker extension" output (speaker level).
guitar amps usually have unbalanced 1/4" phone jack "effects send" output (line level) and 1/4" phone jack "speaker extension" output (speaker level) only. it is very rare to find a guitar amp with built-in XLR output (mic level) to send audio signal direct to the mixer.
to use d.i. box with a guitar amp, plug a short guitar cable into the guitar amp's "effects send" output then plug the other end of the short guitar cable into the input of the d.i. box.
speaker level d.i. boxes can accept signal from an instrument amp's "speaker extension" output. to use
speaker level d.i. box with an instrument amp, plug a
speaker cable into the amp's "speaker extension" output then plug the other end of the
speaker cable into the input of the speaker level d.i. box.
hope this helps.