OCD is most definitely an illness caused (at least in part) by a malfunction in certain areas of the brain. This has been backed up by extensive study of patients with OCD. Essentially our brains malfunction in two key ways. First the filter between our conscious mind and unconscious mind is broken. Thoughts occur in the unconscious mind outside the control of the conscious mind, that is true for all people. Random thoughts happen all the time. In the minds of most people these thoughts are filtered such that one seldom even notices the unpleasant ones. In those with OCD the filtering is less effective. Second, our brains get stuck in anxiety mode when these thoughts reach our conscious mind, thus causing the obsessive anxiety to occur.
The thoughts are real in the sense that they occur. But in the sense that they represent our actual desires and wants, they are not.
Having a thought pop in to your head does not mean you choose that thought. Our brains are constantly processing sensory data and trying to interpret it, in addition to making connections between this data and past experiences. This happens without conscious effort, the same way your heart beats without you making it do so. The information is then filtered and fed in to your conscious mind where you can process it deliberately.
Think of it like mail. Mail delivery happens without you having to cause it to happen (unless you work for the post office I suppose

). Every day you receive mail, some of it interesting, some of it useless. You filter the mail, keeping the stuff with meaning, and throwing out (recycling hopefully) the junk. You don't ASK for the junk, the junk just happens. If you get an add for guns in the mail it does not mean you want to buy a gun for example. Our brains are the same, we receive thoughts all the time, some of them useful, some of them junk. OCD people's minds have a hard time filtering out and throwing away the junk.