Grammarly is definitely safe to use.
There is no way that you can get a virus FROM Grammarly ( unless it is a pirated version, fake version, trojan computer virus, etc)
In my experience, it is very safe. Since I use a Mac, all of my use of Grammarly seems to take place on their server and site rather than on my laptop.