It would be straightforward to filter choices by "location" rather than department. For example, when a caller selects the "Company Directory" option, direct them to an IVR that asks "For location A, Press 1". "For location 2, Press 2", then based on the user's selection, send them across a bridge to the correct company directory.
However, I have often pondered how large organizations with potentially thousands of users, and many departments spanning multiple 3CX servers could share a central "company directory". The fact is that you can not do this out-of-the-box.
Years ago we built a "Unified Directory" web application that displayed a consolidated list of users and also allowed you to group, sort, search, monitor status, and call users from the directory. With this approach it would be straightforward to do what you ask. However, our tool was more of an internal directory, rather than a customer-facing phone tool. To make a phone-based consolidated "Company Directory", you could build a CFD application that mimics the existing "Company Directory" that comes with 3CX... and maybe add some additional features such as searching by department.
Building a consolidated list of users was a challenge we solved a decade ago, but building a replacement for the "Company Directory", while completely feasible, would take some effort. But it is not a technical challenge. It would just require time, and funding.