In our case, it's a strict no, no matter whether before or after examinations. We would have to relinquish the gift and do a lot of tedious paperwork to document how we were or may have been influenced by the gift. In other words, not only would we not enjoy the gift, the attempt to please us would end with punishing us with a lot of tedious paperwork. I can imagine this to be the case in many institutions.
Why after the examinations, too? I assume the reasoning is that, if it gets known that gifts are expected/accepted, there may be an incentive to pre-announce them. So, the policy is strictly no gifts.
@MaartenBuis' response is thus by far the best one: a nice thank-you card will always please your professor and not cause any trouble.