Don't see why not. The cadence function is a sensor mounted somewhere on the frame activated by a magnet on a crankarm. I'm sure you could find a way to glue/ziptie the bits on a spinbike.
On the other hand, since you don't need to watch the road on a stationary biker, it's real easy to figure your cadence by looking at a watch and counting strokes for 10 or 15 seconds. That's pretty easy even on the road, in truth. If you do it occasionally it's not hard to get a feel for what different tempos feel like.