No, it is not recommended to feed elderberry to hamsters.

Elderberries and parts of the elderberry plant contain cyanogenic glycosides, which can release cyanide when ingested. Cyanide is toxic to animals, including hamsters.
Feeding elderberry to your hamster can lead to serious health complications or even be fatal. It’s important to ensure the safety of your hamster by avoiding any foods or plants that are known to be toxic to them.
Also explore the compatibility of these foods for your hamster:
Pasta, Turkey, Beef,
Stick to a well-balanced diet for your hamster that consists of hamster pellets, fresh vegetables, and occasional safe fruit treats. If you are uncertain about the safety of a specific food or plant, it is best to consult with a veterinarian knowledgeable in small animal care to ensure the well-being of your hamster.
Further Reading :
https://vethelpdirect.com/vetblog/2023/05/20/what-is-the-best-food-for-hamsters/