Or do you mean to say that they can detect when an employee tries to sign up for a second account under the same personal info, and so then the sign up fails? If it is this, couldn’t they just obscure their personal info and use a second credit card in the second account? Not a US citizen but it seems unbelievable that Apple could legally compel its employees to use their personal accounts at work.
Apologizing for being the Well Actually Guy, but GitHub's terms of service include the line "One person or legal entity may maintain no more than one free Account". If your employer doesn't provide a work account for you or use Enterprise GitHub, then technically you can only have both a personal and a work account if one of them is paid. My suspicion is that GitHub doesn't go out of their way to enforce this, but it's there.
As far as Apple IDs go, there's absolutely nothing that prevents you from having multiple ones, though, no. I think I've had work Apple IDs in the past. You can also have separate Apple Store accounts and Apple ID accounts (which I do, although that's something of an accident of history in my case). While I've logged into my Apple Store account on a company-owned device so I could use some of my personal applications (ones that would be appropriate for work, for the record), I would absolutely not want to log into my personal Apple ID -- the one that accesses my personal mail, calendar, iCloud Drive, etc. -- on a company-owned device.
So clearly, there can be a delineation of personal vs. corporate entities there if I don't elect, for example, to use my personal Github account versus my work Github accout, which I signed up for using my company email address. If under that scenario, the company cannot claim ownership over my personal email account, then clearly my person is not the same legal entity as my employer and I can keep both free accounts without violating Github's T&C, isn't that correct?