While "before" is a preposition, "prior" is an adjective, so you'd need to keep your wits about you when making substitutions. I wouldn't advise you to count on any rule of thumb at this stage, and I'd only be able to say whether or not a particular example works.
Think of the word "early," which is also an adjective. The comparative form, "earlier" is similar to some uses of "prior," but it takes a different preposition, "earlier than" instead of "prior to." "Prior" can also mean "of greater importance," rather than simply, "earlier in time," sort of in the way the noun "precedence" can refer to importance as well as to time.
I wanted to go to her party but I had made an earlier / a prior committment.
The flight to Washington on [airline] XXXX leaves before / earlier than / prior to the one on ZZZZ. (I guess you'd have to say that "earlier than" and "prior to" function as adverbs, while "before" still functions as a preposition. Opinions to the contrary are most welcome.)
One curious thing about "prior" as an adjective is that it can mean before something without saying before what. "Prior knowledge" is a frequently used term these days (possibly legal) used in connection with "insider trading" cases. The person had knowledge of something before he was supposed to, but you only need to say that he had prior knowledge.
This really deserves many more examples, but I have to go to work. I've probably only succeeded in confusing you. Good luck, - A.