Thanks for your questions.
In the Australian Parliament there are no laws about senators or members of the House of Representatives leaving their political party and joining another party. Members are free to become an independent or join another political party whenever they wish, although this is not common.
Each political party has its own rules about members leaving their team. If a member of parliament wanted to join another party, their current party would need to decide what to do.
Section 15 of the Australian Constitution states that if a senator dies or resigns from the Senate they are to be replaced by a new senator from the same party. If a senator has changed party while serving in the Senate, their replacement will come from the party which the departing senator was a member of when they were elected.