Will an AC compressor work upside down?
No, a typical fixed-use AC compressor will NOT work properly in any orientation but upright.

Most designed have a sealed can containing the compressor itself with an electric motor driving a crankshaft to which a connecting rod is attached which drives the pump.  The bottom of the can is filled with lubricating oil for the bearings on the shaft and connecting rod.

If you invert the unit the oil will go to what is normally the top of the can and will not lubricate the mechanicals properly.

Here is a diagram that shows the basic layout of the parts:

AC compressor diagram