You can feed your guinea pig fresh grass instead of hay if its not chemically treated and doesnt cause any digestion issues. However, hay works better as the main food for guinea pigs than fresh grass in the long run.
We will examine the nutritional differences between fresh grass and hay, discuss the potential health implications, and provide guidance on how to incorporate fresh grass into your guinea pigs diet safely.

Fresh grass along with some green vegetables are a fine substitution for most small herbivore species like guinea pigs and rabbits, but any food change must be done gradually to avoid diarrhea.

I got downvoted pretty quickly for saying that hay has less calcium than grass because "hay is grass" but here is some additional info for anyone interested. Despite the significant variation between different sources of hay and pasture, there are some general differences between hay versus pasture, including:

If you're wondering whether grass can be a suitable alternative to hay for feeding your guinea pigs, this article explores the pros and cons of using grass as a substitute and offers tips for incorporating it into their diet.