Just because an anime character is technically a good guy doesn't mean that everything they do is, well, good. Sociopathic anime heroes turn the concept of heroism on its head. These characters might do the right thing, but their reasons and their methods don't always seem noble.
Some may lack the capacity to empathize with others, and act on their inability with violence, manipulation, or coldness. Some, like Hellsing's Alucard, actually love violence and are teaming up with the good guys because it offers them more chances to cause harm. Some feel remorse, and some don't, but none of them are typical heroes.
One thing to keep in mind as you read - this article isn't assessing whether or not the character could be diagnosed with antisocial personality disorder, an actual condition that impacts real people. Instead, this is simply an interesting lens through which to view our favorite heroes - it's not meant to be taken super seriously.
Karma Akabane is fully dedicated to good guys' primary goal - assassinating Koro-sensei and saving the world. But that doesn't exactly make him a nice guy. Whether he's nearly getting expelled for fighting, shoving spicy things up his opponents' noses and laughing at their reactions, he loves sowing chaos wherever he goes. He does have a moral compass, which is what keeps him on the good guy's team to begin with, but he delights in causing harm to his enemies.
Alucard is a vampire who works for an organization that's dedicated to hunting vampires. Why would he want to help out Hellsing when they target his own kind? It's not out of any sympathy toward humanity - though he does develop a smidgeon of that as the series progresses. But really, all Alucard wants is the opportunity to take as many lives as he possibly can without experiencing any consequences for his violent behavior.
Izaya Orihara is actually the villain throughout Durarara!, the anime he appears in. But there is a spin-off novel in which he's the protagonist, and therefore the hero of his own life. Sometimes, Izaya behaves heroically, like when he stops a girl from blowing up a building. Sometimes, he does the exact opposite, like when he affixes the bomb onto the cieling and sets it off for his own amusement. Izaya acts only in accordance to his own desires - sometimes that means he's doing good things, but he has no qualms about manipuating and hurting others when it suits him.
Osamu Dazai is named for the author best known for the book No Longer Human, a story about a man whose severe depression makes it impossible for him to relate to other people, and compels him to badly hurt them while remaining firmly focused on his behavior's impact on himself. As a character in Bungo Stray Dogs, Dazai sometimes reflects the same energy that appears in the real Dazai's book.
He's also willing to commit major atrocities that go beyond what his comrades find acceptable. For example, Kyouka expresses remorse and sadness because she took 35 peoples' lives, Dazai shrugs it off and claims that that's nothing in comparison to what he's done.