This depends on whether the person moving out is a tenant who has signed the bond lodgement form. If they are, and the person moving in is going to be a tenant in their place, the new tenant can pay them out for their share of the bond. The new tenant has to complete and sign a “Change of tenant form”, get it signed by the outgoing tenant, and send the form to Tenancy Services.
If the person moving out hadn’t signed the tenancy agreement and the bond lodgement form they have no right to any of the bond (unless they had agreed otherwise with the tenant or tenants). For more about the difference between a tenant and someone who’s just a flatmate, see “Who’s covered by the minimum tenancy protections”.