By "allow", I don't mean they're purposefully preventing it.
There are many reasons why a given input would not result in the exact same outcome (acceleration curves, processing delays, systems working against each other, etc...).
Games usually aren't designed with non-human input in mind, and mouse input is intended to be used with visual feedback (I.E. you move the cursor, observe the effect, then adjust your next movement according to the previous result), making it one of the least reliable methods of automation.
Generally speaking, if you can do something with keyboard input, that's the way to go. Don't get mouse input involved if you don't need to.