Short answer is yes.
The long form answer is yes, IF the equipment is in good repair. Especially important is that any donated weight machines must be inspected by any maintenance professional. You may ask the local gym to donate some time from their maintenance crew to inspect the machines at no to little cost.
I don’t see why not! However, because it is donated, and because it would be intended for use by the public, I would be extra careful in having it checked-out by a qualified and certified exercise equipment repair person, and given a “written” clean bill of health before I put any of that equipment on the floor for use by the public.