Dota 2, by default, constrains the mouse cursor to the game window. To disable this behaviour, do the following:
Navigate to the following directory:
steamapps/common/dota 2 beta/game/dota/cfg
And add a new file called autoexec.cfg
, with the following contents:
dota_mouse_window_lock 0
Restart the game for the changes to take effect.