I would like to generate 500 unique codes, so that only those 500 people can access a livestream. Entering their unique code as a password.

Can this be done?

Yes. I need more information to fully understand the scenario but generally speaking you can use the wix-users api to hold the 500 users (to generate a password you can write a simple javascript function that generates one in the length you desire). They would need to be site members and have an email address and password (The code you assign them). Finally you can make the livestream page a members only page restricting access only to those 500 users.

you can find the api information on wix users here:
https://www.wix.com/corvid/reference/wix-users.html

and some reading material on the member system here:
https://support.wix.com/en/corvid-by-wix/wix-members-with-corvid