That's just the cover trim (kinda like what used to be called a hubcap). It is not the wheel/rim itself. You should be able totap it back into place with your hand or a rubber mallet.
As for whether or not it is safe, you and I do not have x-ray vision and cannot see if there is wheel/rim damage under the cover trim. To be sure you would have to remove the cover trim and have the wheel inspected. I would normally be concerned if I saw more obvious problems (like tire damage, or if that cover trim was cracked or broken).
If it were me I would keep on driving and not worry too much (unless it's a front wheel, then I would at least get the alignment checked after a curb strike).