Your contract will specify the inspection deadline. You can certainly do all the inspections you want before you get an agreed-to contract on most properties. But you will waste a lot of time and money on the inspections.
Building don't "pass" or "fail" inspections. The inspector notes problems, then you haggle with the seller over the price. Certainly you want to look at the building carefully and consider what you see in making offers. Make the offer based on what you can see and expect. Then, if something significant that you didn't notice is brought up by the inspection, renegotiate. Up until the inspection deadline, you can always just plain back out of the contract and get your EM back if the inspection is not to your liking.
In my experience, inspectors point out a bunch of obvious problems, so you can almost always find some reason to escape, if that's your choice.