There are a number of conditions that can cause symptoms that resemble OCD, these include traumatic brain injury and brain injury caused by dementia's, this is not the same as saying OCD causes dementia. Anxiety and OCD can have a profound effect on memory but this is due to the condition interfering with the way people think, people often think they have a memory disorder but this improves as the symptoms of anxiety or OCD reduce. There are one or two case studies around about people with OCD who develop dementia but this isn't evidence of anything really, people with blond hair develop dementia that doesn't mean blond hair is a risk factor, we need to know if more people with blond hair develop it, and they don't. At the moment there is not convincing evidence of a causal link, In fact the evidence is so weak I actually surprised anyone even mentions it.