Employers may be able to rehire employee(s) into a different department. However, whether this is good business practice does depend on the reason for contract termination. For example, if the rehire is due to business restructuring or a redundancy then there is no law preventing it.
If the rehire is down to fire and rehire to enforce less favourable contract terms, then this needs to be a last resort. Every contract termination must be down to a fair basis and employers must follow consistent internal policies.