Yes with the appropriate tools. You’ll need a chain whip and a lockring tool for the cassette. Some of the lockring tools come with a lever attached, with others you would need to use a wrench (12" adjustable wrench is usually good).
This is determined more by chain length and the capacity of the derailleur on your bike.
11 speed chains are compatible with 10 speed cassettes (same internal width) but 10 speed chains often will not work well on 11 speed cassettes (different external width).
The cassette you put on the trainer should closely match the cassette on your bike’s rear wheel so that your shifting works as it should. Two main things to get right:
The number of cogs on the cassette (i.e. 9, 10, 11 speeds).
The gear range of that cassette. For example - the smallest cog might have 11 teeth on it, and the largest cog might have 28 teeth. The gear range for this example is described as 11-28.