Is it safe to ground electrical appliance?
Is it safe?  Assuming your ground isn't faulty, yes.  But there's no need.

In order to meet code, an appliance with an ungrounded metal frame needs to be double insulated: that is, it needs to be designed in a way that it takes two failures for the exposed metal to become electrically live.  For example, in your lamp this could take the form of insulated wires plus a non-conductive paint on the inner surface of any metal the wires might contact if they broke.