Since hamsters are also rodents, they will eat whatever they found --- especially when it comes to sweets --- without deep thought. They even don't think if the food is harmful or not.
Hamsters like sunflower seeds, like every rodents do.
Instead of seeds or nuts, let's feed hamsters veggies such as cabbage or other leaves. They love it. Veggies don't make your hamsters over weighted,
Strong herbs, like garlic or celery may lethal for tiny hamsters. Even though herbs are good for human, those strong flavored leaves may harm hamsters health. Please avoid celery, garlic, or onions etc. Hamsters will eat whatever they get without thought, only you can protect them from food poisoning.
Rodents' teeth never stop growing. This is why they need to bite something hard all the time. For this reason, you need to give them something to bite. Veggies are too soft for this purpose, you may want to give them hard pellets or piece of wood.
Hamsters like fruits too. You can feed small potion of your dessert like berries or wedges of apple to hamsters, they will be delighted. The basic rule is, mild fruits suitable for babies are also suitable for hamsters. You should avoid tropical fruits (papaya, mango etc). Even some people show allergic reaction for those strong fruits, those tropical fruits can be too strong for hamsters.