Can ants come out of guinea pig hay?

They can, but they shouldn't.
If your guinea pig hay has ants coming out of it, it's long past time to change the hay.