Can I use a rim brake rear wheel in a disc brake bike, for indoor training?
The standard hub width for road wheels with QR is 130mm for non disc and 135mm for disc hubs. Even though you can force the frame to clamp around narrower hub, it is strongly recommended to add spacers to the axle to adjust the width. As mentioned in comments, if you have hydraulic brake it's best to insert a spacer between brake pads so that you do not eject the pistons if you accidentally grab the brake.