Depends how "unrelated". I have friends with non-CS PhDs who work as programmers, but they were all doing largely computational science.
Ultimately if someone has the right skills, they can get a programming job. If they don't have the right skills but are smart enough, they can acquire the skills needed to get a job in a reasonable amount of time (months, not years). But employers won't just assume that someone with a completely unrelated PhD will be able to pick up programming on the fly.