If the suit is against me personally, let’s say a sexual harassment accusation, can the company also be sued by the accuser hence it would be in the company's best interest to provide me with legal representation?
Understanding that the applicable law differs from state to state, and answering as a Texas lawer: If you are sued for conduct undertaken in the course and scope of your job duties, you probably have a common law right to indemnification from your company for any liability that results from your on-the-job conduct. If the complained-of actions fall outside of your job duties, you are much less likely to have have that right. In fact, the company may have a common law right of indemnity against you to the extent it faces liability for your conduct.
The most likely scenario is that both the company and the individual are sued, particularly when the accusation is one that usually involves systemic contacts, like sexual harassment in the workplace. And it typically would be in the company's best interests to provide you with representation.
If the company-provided lawyer also represents the company, everyone must be clear about the obligations owed by each party, including the lawyer. The potential for conflicts of interest and waivers of privilege abound in that scenario.
The company probably would not directly hire a lawyer for you but indemnify you for your legal costs through an applicable insurance policy (depending on your position within the company). That way conflicts of interest are avoided.