Programs & Events
You are able to set different price points for users when creating a program or event based on whether they are a member, volunteer, or guest. If there is a price difference and folks are not logged into Communal they will see a banner when they go to select their registration opportunity. The banner will outline the price difference and encourage them to get a membership.
If you have a different use case for needing a discount code for a program or event you can certainly set one up. Learn how here.
Memberships
Yes you can set up discount codes for memberships! Learn how here.