Common standard axle lengths are 135mm for QR, also 130mm for older road QR. Thru axle common standard is 142mm. Plenty of other less common standards are out there though...
Adaption of rear hubs/axles designed to fit multiple standards usually involves changing the end caps on the axle, the caps can be screw on or push fit but tend to be hub/manufacturer specific.
Fronts tend to be simpler - both types are commonly 100mm width so poking a reducer into a thru axle works.