Originally Posted by
dsaul
There are three possible thread pitches for a 12mm rear thru axle. 12 x 1, 12 x 1.5 and 12 x 1.75. There are also varying lengths based on what standard the frame manufacturer used. All "boost" frames do not take the same length axle.
All About Thru Axles - Fairwheel Bikes Blog
In addition to overall length, you also need to match the length of the threaded section of the axle. Too short is bad as the axle threads could bottom out before the hub is fully clamped in the frame. I don't know what happens if the threaded length is too long. It's probably okay up to a point.
At least, that's the way it works for non-boost frames. Maybe the industry did a better job of standardization with boost, but I doubt it.