Yes. It’s sucking air and dirt from your keyboard!
I would, however, look for a vacuum cleaner designed for use on computer keyboards. A large vacuum (like you might use on your floors and furniture), with its high power and large hose could suck loose key-caps off the keyboard.
I’d also be worried about static discharge from it. Once upon a time, office supply catalogs used to advertise keyboard vacuums as being anti-static, but they seem pretty rare these days. The only “ESD safe” vacuum cleaners I found on Amazon start at $110 and can get very espensive - a bit overkill if you don’t have an electronics lab you want to keep clean.
For my desktop systems, I disconnect the USB keyboard to avoid spurious keystrokes.
For laptops, I lock the screen (if I don’t want to shutdown) - the computer beeps a lot during the cleaning, but the keystrokes don’t do anything until I enter my password to unlock the screen. I think KeyboardCleanTool is a much more elegant solution to this problem.
This really should be built-in to all devices these days, but so far I’ve only seen a “screen cleaning” mode on a Honeywell thermostat. You go through a menu to enter this mode, and the touch-screen locks-out all keystrokes for 60 seconds, giving you plenty of time to safely clean it. I think Apple (and Google, and everybody else) should provide a feature like this on devices with touch-screens.