In many, probably most, universities, who is a member of the faculty is a department matter. Departments do the hiring, not the university as a whole and departments have budgets and specific needs. HR in the US, at least, is there to assure fairness and compliance with laws and regulations in the hiring process.
I don't think it is a taboo or a matter of "territory", but in order to switch you have to follow the other department's hiring procedures, including applications, and such, to assure that you are a good fit. They also probably need to have advertised a position (at least in the US) and to have accepted other applications. And, expect competition for any open slot. The faculty of the "new" department will need to have a say in whether you are accepted, as usual.
It is more like finding a new job than anything else, with the special difficulty that it is probably not possible to keep the current department from learning of this. Moreover, a person on tenure-track seen as dissatisfied with their position, probably has less chance of promotion. It isn't just a matter of moving your office.
The one "territorial" issue I see would be trying to decrease the budget of the current department and move it to the new. There will be objections to that, I'd expect. If the budget is reduced, then that department won't be able to hire a replacement.
You can, however, collaborate with members of other departments.
To get started, you can ask the head of the other department whether they plan to fill any positions in the near future and informally inquire whether you'd be likely to fit. The formal process, however, will probably need to be adhered to.
Note the US perspective here.