Is it against code to put Romex in conduit?
Putting Romex in conduit is not against code. The NEC permits NM cable inside a raceway, and sleeving it for protection across a basement wall or under a deck is common practice.
Two real constraints apply. Fill: a flat NM cable counts by its widest dimension as if it were round, so it eats conduit space fast. Heat: bundled cable in conduit can require derating.
The hard stop is wet locations. Conduit outdoors or underground is considered wet inside, and NM cable is dry-location only, so no Romex in exterior or buried raceways.
For long conduit runs it is usually cheaper and easier to pull individual THWN conductors instead.
Check how much cable a given pipe really takes with the conduit fill calculator for multi-wire runs.
WireGaugeCalc runs every NEC calculation in one free app, with the code article cited on each result.
Open the calculator