This is not at all the same as closeted gays who may be afraid of social repercussions. It is not a fear of rejection by members of the same sex, but rather is a fear of the attraction itself. Healthy homosexuality and heterosexuality are based around positive feelings, whereas the feelings encompassing HOCD are quite negative and do not revolve around wholesome fulfillment. Instead, they are based around insecurities and the mind playing off these insecurities to falsify reality to the afflicted person. The person will feel an urge of sorts that just "doesnt fit" with themselves, and it causes utmost anxiety, confusion, frustration, and pain. However, the urge/thought does not go away and the anxiety persists, leading to illogical rationalization and depression, among many other negative side-effects stemming from being afflicted with the intrusive thoughts.
For those unsure about what this feels like, imagine getting the impulse to jump off a cliff. You're standing at the edge, and your body and mind scream out "no!!!" but the impulse almost convinces yourself that you want to do it. You have control over yourself, and you may hastily step back from the edge of the cliff, but might for a few minutes be scared and confused as to why you even had the impulse. This "impulse fear" is what drives the confusion in all obsessive compulsive behaviors, and is quite apparent in HOCD as well. The disorder comes with the thought of the impulse being persistent and intrusive, and not being easily dismissed by the obsessive mind. Instead of just being there, it serves to try to convince the person that maybe he did want to jump off the cliff, and maybe that is some actual reality for him. This does not fit with who the person is, and it causes confusion and mental disaster.