You sure can and you should do this to save in overhead. This would save the endo from having to spend $200-300k to build an office. I am an orthodontist and I currently share the office space with a GP owner. I pay this GP a flat rent rate $1700/month. There are 2 separate check in counters.....one for ortho and perio (he also leases the space to a perio) and one for the GP owner. We share the same 7 chairs. The GP owner only uses 2 chairs. Since the owner doesn’t work on Sundays, I use all 7 chairs for patient treatments on Sundays.
As long as the endo doesn’t let the referring GPs know that he shares an office space with the GP, he will be fine. Most referring GPs don’t come to inspect the office. As long as he does excellent work, he keeps the mutual patients happy, and the referring GP get their patients back, he will continue to get new endo cases from the referring GPs. For specialists, office location is not important but it’s how he/she communicates with the referring GPs.