How to Connect to Ground Wire Passing Through Electrical Box
It looks like that electrical box has a mud ring installed on it. The box itself is clearly of a molded type construction such as a phenolic or bakelite or plastic material. If the mud ring is made of metal it is possible that the original installer wrapped that ground wire around the mud plate mounting screw in order to ground the ring. This could be the reason that you cannot pull the end of the wire free.
It is unlikely that the ground wire exits the box completely and travels off to some other destination. If that is the case you may be able to reach inside the box and cut the wire in a manner to maximize its length and then simply attach the light fixture ground to the end of that wire.
An alternative, while not optimum would be to bend the ground wire back on itself so that it comes to a double width point. Then use a green wire nut to attach a bare solid copper wire pigtail. Then the pigtail becomes available for connecting to the light fixture ground.