That kind of flanged joint is not restricted by code.
Please note that the pressure-temperature rates of each flange are probably not the same.
Pressure-temperature rate of the entire flanged joint is of the lower (ASME B16.5: 2.3.2)
It is often done. You do need to address the potential for galvanic corrosion and coefficient of expansion differences depending on operating conditions.
It requires studs, nuts and a gasket, assuming both flanges are of the same size and class. The joint has the rating of the lower rated of the two materials at the design temperature.
Everything else is speculation about the risk for galvanic corrosion, which probably is not an issue 95% of the time when this is done.
This is commonly done were you have a spec break. The gasket ensures the two flanges are not in contact with each other so the only galvanic corrosion issue would arrise at the bolt/washer to flange interface when/if the metals are dissimilar. Note reiterated above on the pressure rating differences.
The issue over galvanic corrosion requires some water to be present to complete the circuit. If you have this inside or outside the flange then you need an insulating gasket or ring and bolt insulators.
Remember - More details = better answers
Also: If you get a response it's polite to respond to it.
I did a lot of this type of connection, especially right now we are constantly upgrading our offshore platform piping system, changing a lot of CS linework which had been there fore 10-20 years to new SS linework, and yes, you should have gaskets in place to do that.