In a perfect world, with perfect electronics, there would be no need for a grounding conductor. It's there to deal with imperfections. The most likely case for a ground fault in this installation would be if the black conductor lost some insulation and shorted itself against the frame of the fan. In such a situation, the casing could become electrified, and a grounded person, touching the fan body could receive a shock.
If it were properly grounded, you'd get a short circuit to the ground wire, and the breaker would trip.
However, the fan is mounted to the ceiling, and the possibility of someone touching it is low. (Unlike, for example, the frame of a fridge or stove, where human contact is part of normal operation.)
So, Is it safe? Quite likely. For added safety, turn the wall switch off when changing bulbs. Is it to code? No. -- Unless, as others have suggested in comments, the mounting box is grounded on the other side.
You can however, locate the breaker, and replace it with a Ground Fault Interrupt breaker, which would trip should a ground fault occur. This isn't something you should do yourself unless you have experience working in the panel.
Another possibility, if your switch happens to be chained off of an outlet, which is quite possible, depending on the routing of the wiring on that circuit, is to replace the outlet with a GFCI outlet, and wire the switch to the load side of it.
You have two issues:
Strength of the hickey - Some hickeys are cast from cheap pot metal and would be sketchy. Some are steel but bent in the shape of a U with one open side, also problematic. Heavier cast iron ones with support on both sides wold probably be better.
Strength of the crossbar - Also an issue. consider a heavier duty type or even a full round. Then consider doubling the cross bar up with small bolts joining the pair.
Supplement - In line with other answers and comments, there are real risks installing a fan with other than a properly rated fan box. Perhaps most important is the security of the box itself. The fan depends on the plate, the plate on the hickey, the hickey on the stud and the stud on the box. Is the box well enough attached that it can't be loosened by fan vibration? Also, if the plate is not pulled tight against the box, the fan is balanced on the single point of the extension coming from the hickey.
Best Answer
That is a joist centered fan rated ceiling box. I installed one of these during my remodel 2 years ago. It is a standard mount, so I'm not sure what you mean by the mounting doesn't fit. Show picture of the fan mounting plate. The box should have 2 holes on each side. Looks like one is partially covered by ceiling texture. Your mounting bracket should have elongated holes also, to help center the bracket over the holes.