The UK, France, USA, Russia and China developed nuclear weapons before signing the Nuclear non -proliferation treaty.
Israel, Pakistan, India and South Sudan have never signed it.
iran and North Korea are under sanctions because they signed the treaty but have tried to withdraw. The sanctions being because the other signatory nations (every one but the above four) do not accept their withdrawal meets the conditions of Article X of the treaty which only allows withdrawal when - "extraordinary events, related to the subject matter of this Treaty, have jeopardized the supreme interests of its country".
If Australia wished to develop nuclear weapons they would also have to announce their withdrawal, and meet the conditions of Article X, in order to avoid sanctions.