CoD, Halo and BF have absolutely atrocious communities because they have large communities. Niche/Indie games have better communities on average because they're smaller and not made up of the usual mainline trolls.
Define troll though. I think in Dark Souls' case for example, the trolls are a very welcome part of the community, simply because alongside them, there's a bunch of people that take the game waaaaaaaaaay too serious and get massive butthurt if they lose in PVP. In Dark Souls' case, those trolls do wonders for weeding those people out. You can find tons of DS youtube channels where people literally just attempt to tick off some of the more serious players.
I think every community has it's bad apples, it's simply all about how the community chooses to handle them or which crowd the game attracts more. For example I know one guy once explained he thinks there's less stereotypical "Call of Duty kiddies" in Team Fortress 2 because TF2 relies more on teamwork, and therefore the egomaniacs with something to prove just get frustrated and leave.