DDSLoader loads textures based on the S3TC texture compression format. This type of texture is used in the mentioned example and requires a special loader for loading and processing. So if you use the mentioned line of code in your app, MTLLoader will automatically use it if it encounters a texture with the DDS extension. If your assets do not use S3TC at all, you can omit it.
No, S3TC can be used with other 3D formats like glTF. Texture compressions is great since you save a lot of VRAM and the GPU does not have to decode the entire texture during the loading process (this is necessary for JPG and PNG). Decoding is usually implemented in hardware and done on-the-fly when the GPU actually reads a block of texels.