using the local campus gym w/o university affilation?

I know that most gyms are closed now (thanks covid) by where I live.
However, my question is, on non-covid days, can people who did not attend a particular university use their gym if they pay money to use it? I live next to a particular college (College A in this example for privacy reasons) and I attended another college (College B). Can I sign up for public admission for the College A gym , as College B is about 9 hours from where I live?

Depends on the college. Many sell memberships to those who live or work in the area. Ask College A.

Of course, for many places this is a moot point when gyms are closed.

There may be an ability for the public to join or pay for single use. There may be several different tiers for memberships (alums, neighborhood, hs students or children). There also may be classes you can sign up for, like swimming lessons, aerobics, spin classes. My kids took a lot of lessons at DU growing up because their school was just down the street - hockey, gymnastics, lacrosse. We went to many birthday parties at the DU field house after swimming, rock climbing, gymnastics, or some other activity first.

DU probably has as many community members in the gyms and pools as they do students at any time.