Two inches is an odd size for framing material. It might be a 2x4 set flat, which is actually 1 1/5 inches thick.
It is highly likely that this framing member is attached to the cinderblock at several points. If this is so, there is no issue with just attaching to the framing.
If the framing is not attached to the cinderblock, it would be significantly less sturdy than a conventional wall in which the 2x4s are set on edge. In standard framing you are attaching to an edge that runs 3 1/2 inches deep. That means your setup would be more prone to bowing, especially in the middle, under the weight of a heavy load.
There are many factors that go into whether or not that would pose a practical problem. How heavy a load will be on the wall units? How far from the wall do the units extend? How many studs can you attach to for each mounting device or unit? How close to the ceiling and floor (the strongest areas) are the principle attachment points?
If you cannot determine whether the studs are attached to the cinderblocks, I would probably try to anchor into the cinderblocks, at least at several points, but not necessarily every point of attachment.
SUPPLEMENT
There are two forces at work in a wall hanging - downward and outward. Assuming the fastener is in a solid medium like framing wood, the downward force, shear force, is controlled mostly by the the ability of the fastener to resist being broken across its circumference. In general, standard screws and bolts are plenty strong.
The outward force is largely controlled by two things - the strength of the fastener in the support material and the rigidity of the support material. Again, standard screws or bolts in wood are up to it (these systems are designed for that). The problem, if any is the ability of the framing to stay in place.
The main support mechanism is near the top of the unit (that horizontal hanging strip), and the framing near the ceiling is fairly secure because the vertical studs are attached (hopefully) to some sort of top plate, spreading the load.
You are probably safe going into the wood. But if it were me, I would not rely on probably, and I would anchor into the blocks in at least three places along that top hanger. If they are hollow blocks, I would try to hit a hollow and use a toggle type anchor. If solid, an expanding masonry anchor.
Usually 2-feet is the minimal depth or 1-foot on either side of the rod, more is better even if it's just an inch or 2. In your case you can do an upper & lower rod at both the front & the back of the closet, without any need for center supports.
However, no rods nor sockets nor anything should be just screwed in anywhere. They have to be screwed into the wall's framing studs. You probably won't find studs where you want to have the rods.
So, what needs to happen first is that full depth of the closet wood slats or slating need to be screwed to the walls at the stud locations. These slats or slating now become your nailers or screwers & only into these will you put any rod or socket screws to then have the rods wherever you want them.
Best Answer
A 2x2 glued to sheetrock won't support any weight.
Instead, go through the sheetrock and install a masonry anchor in the cinderblock. Put a screw through the 2x2->sheetrock->cinderblock