Can contributions be made if an individual is still working but enrolled in Medicare?

If the individual is still working, neither their employer nor their spouse (nor anyone else) can contribute to their HSA after they enroll in any part of Medicare, including Part A. See FAQ What happens when an individual becomes eligible for Medicare?

What happens when an individual becomes eligible for Medicare