For sampling, I always ask, unless the supermarket has like toothpicks and garbage cans specifically for sampling (like with olives).
Regarding eating for food before paying for it, I think it depends on cultural considerations. In many places snacking while shopping is very common. In other places, it is frowned upon. If it needs to be weighed, I would only eat it if the products already have a price sticker (like in the baked goods section). Otherwise, you are paying for less than what you bought.
Easiest solution is to ask someone in the store if they mind.