A man in Western Australia has been shot by police after an officer was allegedly physically assaulted during a callout.