Just because a filter will fit does not mean that it can be used interchangably with another one. Oil filters usually have a built-in bypass valve that is set to open at a certain pressure differential in order to provide oil to the engine even if the filter is totally clogged. The bypass pressure can be different for different filters, even though they look the same and will mount on the same engine.
That said, you can use the 12 valve and 24 valve filters interchangably. Fleetguard, the Cummins filter subsidiary, recommends the LF 3959 or the Stratopore LF 3894 filter for both engine types.
Loren