If you truly have a terrible boss who makes your life hell, or coworkers you battle with who make daily life that much of a hassle, then yes – it’s probably better to find employment elsewhere. But before you do that, make sure you take a long, hard look in the mirror and consider for a moment that YOU might be the problem as well.
If the company is a good one and you’re at a job with room for advancement, try to bridge gaps with bosses and coworkers before you bail. It’d be a shame to throw away an opportunity just because you didn’t want to work at getting along with others. But if the situation is truly unbearable, then bon voyage.