Research grants for international PhD candidates
It absolutely depends on the source of funding. Each organization has their own rules. By and large, the NSF (since you mentioned F-1 visas I assume this is US-centric) allows foreign students to receive funding from grants, but this intent has to be disclosed at the time of submitting the grant request. 

DARPA has slightly tighter rules although I'm reasonably sure foreign nationals can be funded. But if you're from a "country of interest" like Iran, there can be other complications. 

Finally, while these are not PI-requested grants, the NSF-Hertz graduate fellowships are exclusively for US citizens. 

p.s This even applies to PIs. There's a large DARPA program that you're not eligible to apply for unless you have a SECRET clearance, for which a necessary but not sufficient condition is that you're a US citizen.