The HOA for a condo generally covers building maintenance, insurance, and other necessary costs that are shared by all of the units in the complex. Thus, if you buy a condo, you do not have a choice about joining the HOA unless you buy the entire complex (meaning the building and all the units*).
Condo = unit owners own fractional interests in the shared areas (including the building and land).
Co-op = the cooperative owns the shared areas; the members own shares in the coooperative entity.
Both = the entity (HOA/cooperative) pays for the maintenance/other costs of the shared areas. Co-ops collect the money for these expenses through monthly dues and yearly assessments. I do not know how co-ops collect for these expenses.
My unit is a condo; I fractionally own portions of the building and land. My condo pays for the expenses associated with the common areas through monthly dues and yearly assessments.