Is it legal in a multi-unit building to draw air for ventilation from the attic?
These sound like combustion air ducts for a gas heating appliance. Combustion air from an attic is completely in compliance with any US code in the last several decades. It is dangerous to obstruct these ducts in any manner. Doing so can severely compromise the proper combustion and venting of heating appliances, possibly leading to carbon monoxide (a colorless, odorless, tasteless, toxic gas) entering into your dwelling.