Personally wouldn't recommend using hand sanitizer. IPA of various concentrations is already cheap and readily available in every pharmacy section, or a can of WD-40 Specialist Contact Cleaner is also around $5. In theory, hand sanitizer would "work" if it's ethanol/isopropyl alcohol based, but there's such a broad range of hand sanitizers, it would be irresponsible to make a blanket statement that they're all safe/unsafe for electronics. For example, many brands include fragrances, moisturizers, vitamin-E, etc. to keep your hands from excessively drying out, which can end up leaving residue and gumming up your electronics' contacts further.
It's very unlikely that applying isopropyl alcohol this way will actually get under the joystick caps and into the stick's box itself. I'd recommend taking off the front shell and the caps. It's only held down by 5x T9 screws, pop the faceplate off, pop the joystick caps off, and get some 99% isopropyl alcohol (or BW-100 of WD-40 specialist contact cleaner) directly into the stick housings themselves.