A police investigation is underway after a man allegedly fired a replica firearm near the state parliament building in Sydney, Australia.