In Sonic Heroes, there isn't a single "dark Sonic" but rather a couple of characters who act as anti-Sonics or rivals to the blue blur. The two that stand out most are Shadow the Hedgehog and Metal Sonic.
Warning: the following paragraphs contain spoilers for the games.
Shadow is black with red stripes running along his quills, which—unlike Sonic's—point upward in a shape closer to Super Sonic's. He wears hover skates fitted with built-in rockets and has a patch of white fur on his chest. Created aboard the Space Colony ARK fifty years before the main events, he suffers from amnesia in Sonic Heroes after his fall from the colony in Sonic Adventure 2 (and its follow-up Battle), which was his first appearance. In Sonic Heroes, he leads Team Dark alongside Rouge the Bat and the robot E-123 Omega. Although he resembles Sonic, the two differ in abilities, history, and personality, though they aren't exact opposites.
Metal Sonic debuted in Sonic CD as a robotic duplicate built for speed rather than combat. He kidnaps Amy Rose and challenges Sonic to a race to win her freedom; Sonic wins, and Metal is accidentally destroyed by his own creator, Dr. Eggman. He appears in several spin-offs, cameos in Sonic Adventure, and returns as a playable character there and in Sonic Adventure 2.
Sonic Heroes marks his major comeback, where he abducts Eggman and impersonates him while gathering combat data from both Team Sonic and Team Dark. This version, known as Neo Metal Sonic, has a redesigned look and can now speak. He later transforms into the giant Metal Madness and then Metal Overlord, both of which are ultimately defeated by Super Sonic.