They can in fiction, constantly, and it is one of the genre's most durable images. Whether they can in reality is a different matter — the historical ninja were, by most accounts, considerably more practical and considerably less theatrical.
The shadow-hopping trope owes more to Edo-period theatre and later cinema than to any documented technique. It is a visual shorthand for stealth that reads instantly on screen, which is why it has outlasted the historical figure that inspired it.