I see no reason why it wouldn't be legal. I do see some potential issues with that idea though. First, you'll still need a spring and baseplate. I have no idea what that would cost, but might make the whole idea cost-prohibitive. Second, I would question whether 3d-printed feed lips to last the long haul.
I can't help but feel like people must have already tried this, which in turn makes me think there must be a reason why cheap 3d printed magazines haven't flooded the market yet...