Yes there are actually several differences between a Mil-spec receiver extension (a/k/a Buffer Tube) and a commercially manufactured extension.
There are a few easy ways to identify the distinguishing features, such as the Mil-spec extension typically offers 4 position adjustments and the commercial extension offers 6.
Also, the rear side of the Mil-spec shaft is flat as opposed to the slightly slanted commercial shaft.
There are a few dimensional differences that prevent the two from being interchangeable. The most obvious difference is that the threaded shaft on the mil-spec extension is slightly larger in diameter and has sharper/finer threads.
Please refer to the image to assist in identifying which style extension you will need to use.