Of course ,you can do it. But you should choose a suitable way to do that. Maybe you can try a kind of special paint pens, and there are a variety of colors. You can go and try to find the color that is same to the color of your glasses. To a certain extent, it can be said, nail polish can also be ok, but it will have a little change of colors.
Well, I think its fine to paint your eyeglasses frame. Because it's only in the surface and it will not damage the eyeglasses. But on the other hand, you should choose the proper material to paint for many painting material will just do harm to the frame. Also, if you don not pay more attention to it, there will have left some objects on the eyeglasses. In this way, it may make your eyes infected easily. So just be careful about it.
If you do it by yourself, I don't think it is safe unless you put it in the outside for the blow up for a while before you wear it again. And if you do it by yourself, you should paint carefully as not to touch the lenses sides. However, the painting material is not good for our health. You'd better buy a new type.
If you want to paint them, I would recommend fingernail polish. It is pretty tough and comes with a brush that is about the right size. If you paint the part around your lenses, you should probably take the lenses out first.