Lucky with a Yogi in his mouth.
It's ok to give rats small treats every once in a while, but it shouldn't be an every day thing. I give my rats a yogi treat or small piece of chocolate a couple of times a week.
Unlike dogs, rats can eat chocolate in small amounts without any harm. In fact dark chocolate is good to give to a rat if they are having breathing problems because it works as a bronchial dilator and helps rat breathe a little better if they are having respiratory problems. But it should be given in small amounts.
As long as you are feeding your rat a nutritionally complete diet, there's no reason not to give the occasional treat.
Rats don't know what treats are, they like pretty much all food. So you should give healthy treats when possible. Things such as fresh fruits and vegetables should be a daily part of their diet along with a staple dry food. I use Oxbow Regal Rat food as the dry food they always have available and during the day I give them different fruits and vegetables to go along with the dry food.
Any fresh foods you put in their cage in the morning should be removed by the end of the day if not eaten because it can spoil and make your rat sick.
Some foods that can be given as treats are:
Carrots, banana, apple, pear, yogis, dark chocolate, yogurt, broccoli, corn on the cob, watermelon, cherry tomatoes, white rice, brown rice, oatmeal, wheat germ, and pretty much any other fruit of vegetable.
My boys love oranges but because of something in the rind of the orange that can cause cancer in male rats, if you are going to give oranges as treats you should peel the orange and rinse it off before giving to rats, especially male rats.