This article addresses using a 9 speed on an 11 speed hub with a standard 1.85mm spacer.
I am not sure but you may be asking too much to attach a 7 speed cassette onto an 11 speed hub that come with most trainers. You may be able to space it out but I doubt any indexing would work. If you have downtube shifters perhaps you can use friction mode?
With the investment you’d be making in a direct drive trainer you might be better off trying to pick up a pre-owned 11 speed bike to get the full benefit from the trainer.