I am asking this question because I noticed how someone accepted an answer of mine and then "de-accepted" it and accepted another user's answer to the same question. My question is- is it OK to do so?
I would imagine that if it were not okay/ethical the system would have been set up to not allow it.
Sometimes users make mistakes when accepting answers; sometimes users are too hasty in accepting the first answer. I'm sure everyone who has answered more than a few questions has had the occasion to witness the de-acceptance of an answer; I know it's happened to me more than a few times that I've noticed.
While it is annoying and a bit of a hit to the ol' self-esteem, my advice is to let it slide, relax, don't resent the
bastard questioner who de-accepted your answer. And most importantly continue answering questions!
I have posted many requests to OPs to un-accept my answers when they clicked the checkmark too quickly.
Usually the request is stated in words like "if you unaccept it is likelier that experts will see the question".
The OPs usually take this advice, and often the hoped for expert answers or complete analyses do materialize.