The picture looks more like chipboard than MDF, but that's fine as well.
You certainly can make a loudspeaker cabinet out of chipboard. As to thickness, I don't think you can have it too thick. Unless you have extensive experience and measuring equipment, the best cabinet is one that's very stiff and well braced. The opposite is to have a very lossy cabinet, that damps resonances well, but that's far more difficult for an amateur to achieve.
Make the box strong, with all joints airtight, and you'll be OK.
By the way, if the material you're using is thick, remember that what matters is the internal dimensions of the box, so you need to allow for the thickness of the material.
S.