Hi otakisummercamp,
Out of the box this feature is not available. I have seen other users use a Woocommerce extension and custom code this to work. However, we do not support this and you would need to have someone develop it for you.
If you decide to go this route, you can read more about this extension here:
https://woocommerce.com/products/name-your-price/
Another option is to add a donation link in the event where attendees can click and donate.
Hope this answers your question and please let us know if you have any other questions.
Thanks,
Brendan