It is my experience that WD-40 is a terrible chain lube. I get 25k miles using real lube and/or 120wt gear oil from an oiler.
I lost a perfectly good chain in 12k miles. No ammount of WD-40 was helpful. The chain dried rapidly and a red oxide/dust appeared rapidly. O-rings got hard and cracked off. I suspect that the chain got hot enough to cook the o-rings. It was a terrible experience and I will never repeat the test/experiment unless sprockets and chains and WD-40 is supplied to me for free.
WD-40 might (and that is a mighty big MIGHT) be ok as a chain cleaner. But I wouldnt recommend it.
If I was going to wash/clean a chain, I would run garden hose water over it to get mud and water soluable stuff off first. Then, brush it gently with kerosene to dissolve caked greases trying not to force any crud into the chain.
Sure. WD-40 may not hurt o-rings. That doesnt mean that its a good idea for the chain. I couldnt make WD-40 work on my chain. YMMV
"beware the grease mud. for therein lies the skid demon."-memory from an old Honda safety pamphlet