I heard that vacuum cleaners are dangerous to use near electronic components because they build up static...
This is true, in general.
Note, this is assuming the device is off and unplugged while cleaning. Never attempt cleaning on anything powered, even from batteries.
In addition to Seir's answer, the triboelectric effect comes into play when dealing with a moving vacuum-cleaner attachment and brush. Both of these can cause triboelectric-induced static fields to be created, potentially zapping sensitive components.
merely sucking a bit of dust off them with a vacuum cleaner for 5 seconds can cause them to violently explode
Highly unlikely, as long as the board is unpowered. This is probably an extension of the "blown gate" phenomenon, where sensitive MOSFET gates can literally be blown apart by a static spark. But this is on a microscopic scale, and certainly doesn't cause any noticeable explosion. If there are any claims of components blowing apart (from static electricity typical for a vacuum cleaner), these are likely fake or omitting the fact that the device was powered on. The damage is permanent and irreversible, though, whether catastrophic failure or invisible.
Components that are likely to be sensitive to ESD:
- MOSFETs - especially physically small ones like the 2N700x series
- IGBTs - ditto (smaller the gate capacitance --> faster the voltage rise)
- Tantalum capacitors - a tiny surge in the reverse direction can destroy them
- Any type of modern MEMS (micro-electro-mechanical system) device - microphone, DLP projector, gyroscope, accelerometer, etc.
- Some CMOS-based ICs, older are likely more sensitive
- Some other digital IC's - processors, microcontrollers, RAM, flip-flops, gates, etc. (Often not all pins are protected.)
- LCD pixel connections / driver circuitry - especially small, low-power monochrome LCDs like in calculators, watches, etc.
Components that are moderately protected from ESD:
- USB/SD/SIM Cards, anything user-accessible - usually have protection devices (TVS or transient voltage suppressors) next to these - depends on if designer implemented them or not - also cheaper boards can be more susceptible (cost-cutting)
- Many newer-generation IC's with input clamping diodes - check their datasheets - this means that old boards in general can be more susceptible
- LEDs - can be damaged if reverse voltage spike carries enough power (possible but unlikely just from vacuuming - can be damaged if a visible spark jumps to them.)
Components that are unlikely to be sensitive to ESD:
- Resistors/all other capacitors/inductors - themselves are usually unaffected but can couple that energy elsewhere
- Transistors - like LEDs but slightly more resilient.
- Transformers, speakers, potentiometers - anything "beefy" enough that a little spark is incapable of affecting
- Vacuum (thermionic) tubes, all other tube technology (neon lamps, etc.)
any expert out there can confirm or deny if simply changing the plastic nozzle for a rubber nozzle is enough to make a regular vacuum cleaner "anti-statical"
Well, what kind of rubber? If this rubber is conductive and is effectively grounded somehow (external grounding wire?), then the nozzle is probably safe... until you touch the body of the vacuum cleaner, or the hose, transferring charge to yourself, then touch a sensitive component, and poof - device doesn't work anymore.
That said, more electronic components recently are including ESD protection built-in. If the board you happen to be cleaning contains all ESD-safe components (and design) then it would likely be just fine using a regular vacuum cleaner. Still, there is a risk of damage (ESD protection can only do so much), so it's not 100% safe.
The bottom line is, if you want 100% guarantee of no static-electric damage, then a purpose-built anti-static vacuum cleaner is the only way to go.
Compressed air (clean and dry) is also relatively safe. I recommend blowing the dust off using compressed air (outside) as opposed to vacuuming. The aerosol cans are convenient for this, but an air compressor is usually more effective. If it must be done inside, blow the dust and use the vacuum nearby to get most of the airborne particulates; careful not to get too close with the vacuum cleaner. For extra protection you could wear an anti-static wrist strap and connect this to whatever ground the board(s) are connected to.