Is the contractor liable?
It depends. Trespass and conversion would be the applicable torts. In some jurisdictions, those are strict liability torts, in others they are intentional torts. The contractor lacks intent, but did participate in the act. I haven't yet had a chance to check out California in particular. California appears to come close to a strict liability regime based upon the relevant jury instruction and related commentary.
In a suit, would PersonB sue contractor for damages, who would then
sue PersonA, or would PersonB sue PersonA directly for damages?
Person B would sue both. The contractor for participating in the act, and Person A as the principal upon whose behalf the contractor is working as an agent, on a respondeat superior theory. Person A could have liability even if the contractor didn't, in this fact pattern.
Would actions by PersonA be criminal?
Probably, as a form of criminal trespass, criminal vandalism and possibly even burglary (sometimes defined as trespass with an intent to commit a further crime). I'd need to check California's criminal statute definitions to be sure of precisely what. But, in reality, PersonA would usually have a bona fide good faith belief that he had a legal right to do so, and in that case, it would not be a crime.
Would actions by contractor be criminal?
No. For criminal law purposes, the contractor lacked the requisite intent. The intent elements of the criminal trespass statute in California are here.