These are generally meant to be mounted to an overall larger PCB (like in a joypad), with the dome "base" of the stick positioned close to a hole slightly smaller than its diameter (it shouldn't rub on the edge of the hole, obviously). If you wanted to "seal" it against dust/dirt (you'll never get it perfect - but you can get close), cut a rubber "skirt" or "washer" from an old bicycle or car inner tube, and glue that on the inside of the enclosure (use epoxy or contact cement). Lubricate the base and skirt with a very small amount of petroleum jelly, if desired (though this may just collect the dust - leave it off if this is a concern).
I just tackled this problem, how I did it was I went to lowes (a big box hardware store) .. over in their screw section they have some bins marked "hard to find" one of the items was a rubber grommet with a 23/32 inch ID (18.25625 millimeters?)
it was much too tall to fit in the hole without the stick rubbing so I just cut its top off and glued it to the box using some goop (stupid strong contact cement like snot thick glue)
though it does shorten the travel of the stick a bit, so I had to adjust some trimpots (mine is in a true analog situation a game pad for my Apple //C which samples a 555 timer in single shot, you can just do it with some code)
its not sealed (as in dust and water proof) but it does squeak a bit in fast and furious robotron action and you cant see the electronics under, even though the hole cut through the face of the project is at a 1 inch diameter (ie a bit too large) ... if you really wanted to keep dust out you could use a bit of paper or cloth, this is exactly how the Sony PSP does it, with a simple paper washer