different chocolate foods have different levels of cocoa in them as Watchdog said. Milk chocolate has very little in it, so most dogs can actually eat some with no worse than a bad case of the trots. Other dogs, of course, are even more sensitive so even a little bit will cause serious harm, like an allergy in people. Even a little bit of dark chocolate can cause serious problems because it has higher levels of theobromine in it. Caffine, also toxic to dogs, is higher in some types of chocolate as well. Mix the 2 and viola! Poisoned dog.
Because there is no way to know the levels in the chocolate and how a particular dog will react to them, it's easier to say "NO CHOCOLATE" than to give a complex formula for deciding how much is safe for your dog.