It is normal and not dangerous if it happens only sporadically. To prevent this, be sure to warm up suffieciently before your workout and cool down the last 5-8 minutes.
I do not consider palpitations normal after exercising. This is something you need to get checked out by your doctor. There is a possibility that it is no big deal, but I would not want to take the chance.