The Mad Scientist - You guys know the one. He's typically a supporting character (although not always), the scientific and/or medical genius the main antagonist goes to to do his dirty work, whether that's to brew up biological weapons, design highly advanced laser weaponry, or perform a good old-fashioned torture and dissection of helpless paranormal beings. If he's a protagonist, then... well, nothing changes except the people he's working for lol.

Dr. Stein works as a teacher at DWMA (Death Weapon Meister Academy), and he views everything in the world as a specimen to be experimented on, including himself, leading him to drive a large screw through the side of his head and interweave his own skin, clothes, and even his laboratory with stitches. Other than being a scientist, Stein is considered to be the most powerful meister to ever graduate from DWMA and is a master martial artist, making him a deadly opponent in any situation. (Source: wiki)

Mayuri is the current Captain of the 12th Division in Soul Society. He views everyone as objects to be dissected in the lab. He has even made extensive modifications to his own body. Mayuri has little regard for life or allegiances, even going as far as turning his own subordinates into human bombs on one occasion. In the past, the potential danger he posed to the Soul Society led to his imprisonment when he joined the Soul Reapers. Kisuke Urahara (see: Goofy Guys who Kick Ass) recognized his potential as a scientist and released Mayuri to help him with his research. (Source: wiki)

The interesting thing is that both these characters are supposed to be protagonists. Mayuri, I would argue, is neither--he serves himself and his pursuit of knowledge only. He just happens to be on the side of the protag. Stein, on the other hand, might have a number of questionable morals (and an underlying "madness" that he oftentimes fails to suppress), but he is very clearly a "good" guy who protects his students.

Good or bad, these characters aren't necessarily motivated by ideas like "right" or "wrong," which is why they can be either. Their motivations stem from the desire to learn, to dissect a problem (both literally and figuratively), to uncover and extend their abilities for the sake of science and knowledge. And, oftentimes, out of hubris. High intelligence often breeds big egos lol.