People with OCD still learn from their own and other people's mistakes and adapt their own behavior.
It's not the learning part that's important, it's how one applies what they learned, and the way they act on what they fear might happen that can fall into OCD.
An obsession with being always 100% charged when you leave the house, immediately plugging to charge etc, always checking to make sure, etc, can point to OCD, even if it "makes sense" (e.g. to avoid being ever stuck without charge in an emergency).