Sorry
@bimbleuk that's slightly misleading. What did you have to 'match' with your rear wheel? I happily mix a 28T and a 32T cassettes on my other bike and have no problems with indexing (swapping between road wheel & Turbo trainer). 105 5800. Chain length can be an issue, but not indexing. Maybe a slight tweak to the RD to account for cassette wear, but can't recall needing to even do that the last couple of times (both now worn in).
The groupset, or more accurately the series and number of gears of it does come into things - Shimano's 'trickle down' tech should make most 11 speeds compatible spacing wise, certainly those of the last couple of years but I'd always do some googling first to determine if there's any width issues. The newer the groupset components the less likely you'll find issue (it's several series since chain and sprocket widths where changed).
@Saytan or someone with wider experience can maybe elaborate on that if you need info on new component compatibility with something say 4-5 years+ older (older by several series).
Number of gears matters most of all - chain width and sprocket (cogs on your cassette) width have generally changed between speeds. Current 11 speed chains are narrower than 10 speed chains. Not a huge amount, an 11 speed chain on 10 speed will seem ok but you just can't quite get the indexing perfect (or notice it get really poor when components age). 10 speed chain on 11 speed components is a big NO-no. It's too wide and will foul the neighbouring sprockets.
I believe actuation is different between SRAM and Shimano (length cable moves per 'shift' from the shifters is different) so mixing shifters/derailleurs is not usually recommended, although chains and cassettes can be happily mixed so the sprocket width of cassettes must be the same. Newest 10 & 11 speed Shimano and SRAM can even be mixed with some Campagnolo in a pinch (chains & cassettes mostly) but would require indexing.
My Flux's 'freehub' is an Edco design which will accept Campagnolo cassettes and Shimano/SRAM without change. I'm unsure if the Elite or Wahoo trainers have the same freehub or they have to be swapped. This is a non issue for Jobe but worth mentioning to anyone else reading this.
Basically, if you're running Shimano 5800, 6800, R7000, R8000, R9000 & R9100 (all 11 speed) or SRAM Red, Force & Rival (all 11 speed) then you should easily be able to use any Shimano or SRAM cassette without issue.