I think testing DDPF_ALPHAPIXELS is only going to work reliably for uncompressed textures. If it's say a DXT5 texture then it could leave that flag clear and still work correctly. It would also be possible to generate a file where that flag is set, but the alpha channel is actually set to opaque for every pixel.
If you want to be certain, the easiest option is probably to convert to an uncompressed format, and read back the alpha channel. Of course for DXT5 you can be fairly certain there is an alpha channel - for opaque textures DXT1 is equivalent quality, and half the file size as it doesn't store full alpha data. However, a DXT1 image may or may not use the single bit alpha channel feature.
Of course most of the time game toolchains work the other way round - they start with uncompressed RGBA images and convert to .DDS to reduce the memory cost. When you're doing that you can make sure your converter sets a flag somewhere.
Also note that DXT is lossy compression. You will get better quality results if your tools work with uncompressed (or losslessly compressed) textures, and convert to .DDS as the final step.