The VkCommandBuffer should be imported as OpaquePointer?, in which case you can just do == nil.
If, for whatever reason, you don't have the correct nullability being imported, you can do Int32(Int(bitPattern: ptr)) where ptr is an OpaquePointer to convert it to an Int32; however, the better option is to fix the nullability. You may have NS_ASSUME_NONNULL being defined somewhere where it shouldn't be, for example.
Edit: oops, as @jrose says, Int(bitPattern: ptr) is safe but the conversion to Int32 afterwards is most definitely not. The Int32 should be converted to an Int before comparison if you’re going that route.
Er, please don't convert a pointer to Int32. That's one of the things "64-bit" usually means: pointers are 64 bits, and converting most of them to Int32 will fail (trap at runtime) or lose information.