It's not illegal. Just like anywhere else, Australia has laws about where and what you can take from the reefs and what kind of permits that requires. Once they've been collected they fall under CITES and all the same import/export rules as corals from anywhere else.
That said, I'd be skeptical of places that claim to be selling Austrialian corals. Every few months there tends to be a trendy new collecting locality and lots of vendors suddenly get lots of corals from that area at jacked up prices. A few years ago it was Fiji, then the Soloman Islands, then Indonesia, then Japan. It seems very suspicious, and some people have even looked into the sources and found out that some were lying.