Replacing light fixture from 2 wires and ground to 2 wires only
You've asked the right question with "is this safe".  You can install the two wires and no ground and the fixture will function just fine and probably never have any issues, but the ground is there because of that "probably".

If something is wired incorrectly or a connection comes loose or a wire is damaged that ground becomes very important very quickly.  It can be the difference between getting a dangerous shock from the fixture and having a breaker safely trip when the issue arises.

If this is a new fixture that was designed without a ground wire, it could be what is called "double insulated" (rare in light fixtures from my experience).  Basically that means that even if there is an electrical fault, the outer housing of the device will not electrocute you.  If this is an old fixture, the ground wire has probably come off or it was never designed with one.  A picture of the fixture would help, but the basic rule is that the metal housing of the fixture should be grounded.