The toxic ingredient in chocolate is in the mythylxanine class, a substance called theobromine. It is much like theophylline; overdoses of theophylline used to be very common before the advent of inhalers for the treatment of asthma. (Chocolate also has some caffeine in it, which may exacerbate the effects of theobromine.) As @Chris stated, it is only slowly metabolized in dogs.
Generally, toxicity depends on the size, age, the breed of the dog, any medical problems the dog may already have, as well as what type of chocolate was consumed. The larger the dog (given no other predisposing factors), the more theobromine they can handle, and older dogs tend to have more problems than younger ones.
Here is the dose of theobromine that can cause dangerous symptoms, and death:
20 mg/kg (or 20 mg/2.2 pounds, or about 10 mg/pound) may cause agitation, hyperactivity and gastrointestinal signs such as drooling, vomiting, and diarrhea.
At >40 mg/kg, cardiac signs can be seen, and include a racing heart rate, high blood pressure, or even heart arrhythmias.
At >60 mg/kg, neurologic signs can be seen, including tremors, twitching, and even seizures.
Fatalities have been seen at around 200 mg/kg (~ 100 mg/lb), or when complications occur.
Here are the approximate amounts of theobromine per ounce of chocolate:
Cocoa powder: up to 800 mg/oz
Baker’s chocolate (unsweetened): up to 450 mg/oz
Dark chocolate: 150 mg/oz
Milk chocolate: 50 mg/oz
So, theoretically a 40 pound dog (medium-sized dog? My Border Collies each weigh 42 pounds, and are considered medium-sized) will not die if it eats a Giant Hershey's Symphony Bar (a very yummy 6.8 oz / 204g) because that's less than 10 mg/pound. I've never put this to the test, however, and would not recommend it.
Info at https://vcahospitals.com/know-your-pet/chocolate-poisoning-in-dogs