If you have taken the test and approved, Yes you can leave the country and come back for the ceremony.
If you have taken the test and no approved yet. You can still leave the country but you application will not move forward. You have to be in Australia at the time of approval.