For trademarks, unintentional similarities could still lead to confusion in the marketplace. So, coincidence or not, one trademark holder could sue another for infringement and the court probably wouldn't care that the infringement was unintentional and/or coincidence.
For copyrights, unintentional and coincidental similarities
could have a bearing on a court's ruling of infringement in some cases.
It
is possible for two authors to create eerily similar works totally independent of each other. However, if one author can show that the works are too similar to be coincidence - even if it is, in reality, just coincidence that makes them so - he could still win an infringement suit. Often just one sentence worded exactly the same can make mere coincidence unlikely.
Expert witnesses are sometimes called in on infringement cases, more so perhaps with music infringement than with literary or artistic infringement. With musical compositions, the experts will often go over the songs note by note. Although "My Sweet Lord" by George Harrison
sounds nothing like "He's So Fine" by the Chiffons, runs of notes were found by experts, and by the court, to be identical in both, and Harrison was found guilty of infringement. The similarities were unintentional, perhaps coincidental as Harrison claimed, but still infringement.
Sometimes wrongful appropriation of another's copyrighted work can be shown to the court by proving the "infringer" had access to the original work. This was true in the Harrison case, for instance.
Then again, sometimes works will have definite similarities, but the similarities are in the facts or ideas only, and not in how these facts and ideas are expressed. If there are common sources used, for instance, there may be works that are strikingly similar but not infringing. These similarities may arise when the material used is from public domain sources or folk custom, or when there is a large use of contemporary or historical facts.
What would probably be unintentional and coincidental in a situation like this would be if the books came out at the same time.
But, even if the subject matter is the same and the books use the same facts or sources, a court would not find it infringement if the subject matter was expressed or presented in different ways.
So, to answer your question briefly, no. Even if it is apparent that the similarities are unintentional coincidence, the court would consider other factors in determining whether these unintentional and coincidental similarities were infringement, both for trademarks and for copyrights.