Yes, you can use hard candy as a topping for a chocolate cake. You can actually use anything you want for a topping. I’ve seen cakes decorated with: hard candy, candy sprinkles, candy canes, candied fruit, fresh fruit, nuts such as walnuts, cashews, almonds and pecans, cookie pieces such as Oreos and Gingersnaps, Nilla Wafers, etc., and toasted, raw flaked, and shredded coconut.
The possibilities are limited only by your budget, your imagination, and your taste buds. You can also use these same toppings and surround the sides of the cake if you so desire.