Answer:
It depends on how the check was written. If the two names were written with an 'and' in between, than signers from both companies have to be at the branch to deposit it in order to have it endorsed properly. If the two names were written with an 'or' in between, than either company can endorse and deposit it. If neither, and both names were written as if it's one longer name, than you can not deposit it. You will have to return it to the sender and have them reissue you a check.
I hope this helps.