I think so as well but I actually don't know if anyone ever tried to do that, considering how "old" that feature is and that its use is probably not so widespread (anymore?).
Just to let you know: if you try to trigger Target Display Mode on Mojave, the iMac screen goes black for a second and then the desktop of the OS appears again, while on High Sierra the GPU switches to the video input, showing the desktop of the other Mac/PC connected.
Probably it's fixable on Mojave, I don't know how, but at the moment I think having a small HighSierra (or previous slim OSX) partition for that purpose is a good solution.