Yes, you can.
‘Canned air’ is a common, if environmentally dubious, method of blowing dust out of computers. Although chlorinated fluorocarbon propellants have been banned, the replacement propellants, Hydrofluorocarbons (HFC) and hydrocarbons, are still not good for the atmosphere, and throwing away the empty metal cans doesn’t help either.
If you are in the business of computer repair or use air dusting frequently, a Metro Data Vac (available from computer stores and online) is a better product. It costs less than 10 cans of ‘air’
It’s useful for other things like inflating air mattresses and beach balls. I also use it to blow the excess water out of my vegetable garden’s micro-drip irrigation system to prepare for winter.
I would not use a household or shop vacuum on blower mode with a hose – the vinyl hose tends to build up a static electric charge in the air coming though, and I am cautious about that.
Some people have asked about an air compressor, this can be used with appropriate nozzles and keeping mind to limiting the pressure (you can damage components with too much pressure). The caution about compressors is if they are oil lubricated and the oil gets in the air lines – you don’t want to spray an oil mist in a computer.