I think most law firms would represent competing companies in separate cases. Conflict of interest is more representing multiple parties in the same case or issue.
E.g. I once had a lawyer review a severance agreement before I signed it, since it had non-compete language in it. He had to be sure that his firm didn't already have a relationship with the employer.
If there's no common interest in the case, lawyers are expected to be able to maintain confidentiality. Same as an accountant who might have two competing businesses as clients.
But, IANAL.