Ask a simple question, get a simple answer: Many YC companies hire foreign employees. This does cause a LOT of visa headaches for them, so much so that YC has held events for people to swap stories and strategies for getting visa issues resolved. (YC companies additionally frequently have founders coming from abroad, which is a headache which is, if possible, more complicated than hiring an employee from abroad.)
Anecdotally, most (?) YC companies seem to prefer their employees to be located close to them, but that preference is not universal.