All subwoofers have a certain volume enclosure that is best for that specific speaker. Different ranges of volumes are needed depending on the type of enclosure, generally sealed boxes require less volume than ported enclosures. Also if you do go with a ported box, the volume of the port is how you determine the tuning of the box. Make an enclosure too large, or a port too large and you could easily damage your speaker because there would be an increased load on the suspension of the speaker due to there being significantly less air resistance to stop the cone from moving forward or backward.
Most subwoofers come with a data sheet or install manual (that can usually be accessed on their website) that gives recommended size ranges for different configurations (ie. ported, sealed, bp, etc). Here's an example from Pioneer.