Every state is different. You should look at the DOE site for your state. In my state, homeschoolers are allowed to attend any activity that is completely extracurricular. So homeschoolers could go to the prom, but if marching band is part of the school's music program, homeschoolers couldn't participate in that. Sports are usually allowed under this rule.
My state also has a clause stating that districts can be reimbursed by the state if they allow part-time enrollment of homeschoolers in curricular activities and classes, but this is left to the discretion of the superintendent. I contacted my district and the superintendent says that our district does NOT allow it.
As you can see, sometimes it doesn't only vary by state, but also by district.