Not likely. The box dimensions and port size are specific to not only the size of the subwoofer, but also the specific subwoofer. Two different 12" subwoofers may have entirely different enclosure specifications, and almost always do.
Will it WORK? Probably. Will it sound RIGHT? Maybe, but it's unlikely. If the enclosure is smaller, the base will be extremely tight, there will likely be port noise since the port will not have been designed for that subwoofers characteristics and if the enclosure is too small, and the port too restrictive, you will likely overheat the voice coil and damage the subwoofer if you drive it at normal power tuned to the wrong frequency.