In a scenario I've thought up, our villain-protagonist is a temperamental misanthrope, who avoids human interactions at almost all costs. He is a reclusive hermit that makes his living fur trapping. Living nearby his remote wilderness home, is an evil dragon that takes its' jollies terrorizing humans. For whatever reason, the Dragon has burned the hermit's cabin to the ground. Vowing revenge and to prevent further attacks, he tracked the dragon down to its' lair. While he infiltrated the lair and attempting to conjure up a plan to slay the dragon, he accidentally stumbled across several captives. Whom the Dragon has kidnapped for its' private collection. Neither wanting or able to be preoccupied with the safety of that many people, he just left them there as he carried on with his mission. During his fight with the Dragon, the captives managed to free themselves and scurry away. The hermit didn't set out to save those prisoners. All he wanted was to get rid of a threat to him. However, he accidentally rescued them through the consequences of his actions. I know it's a bit self indulgent and defeats the entire purpose of my post, but as I was typing it up, I realized that my "scenario" actually somewhat resembled a fairly common plot lines for many mediums (especially, but far from exclusively, in animated children's films I watched in my childhood). Usually, they entail an overly gruff indivdual who is ostracized by their society for one reason or the other. To compensate for their loneliness and desire for being better understood by peers, they put a cantankerous loner front. When the "journey's call" beckons them, they begrudgingly accept for a initially selfish reason. On the way, they will meet some overly bubbly and clingy side characters that will at first, get on the protagonist's nerves. Over the course of the work, the protagonist would soon learn the importance of friendship. With that, their motives turn a lot more altruistic. The most famous ones I can recall is the Shrek, Ice Age, and maybe even the Mandalorian. What are other characters that resemble what I described in my scenario?
There are tons. 'Zombieland' and 'Planes, Trains and Automobiles' are a few. Maybe even 'Savannah Smiles'. Edit: these are all films, can't think of any from literature, but just remembered 'Due Date'.
This comes very close to another trope, featured in True Grit which I just read. Rooster Cogburn isn't really an accidental hero though, it's more that he puts on a gruff cantankerous exterior but underneath it he has a great heart (the real meaning of 'true grit', which the narrator didn't understand until she came to more fully appreciate and understand him). So people who don't know him at such a deep level might think he's an accidental hero, but there's nothing accidental about it, they just haven't seen past his exterior.
Gully Foyle, the hero of Alfred Bester's amazing SF novel The Stars My Destination, starts out as a pretty repulsive thug bent on revenge who gradually gets smarter and more conscientious as he gets closer to his goal and increasingly tangled in cataclysmic events.