Porting?

Is it possible to port Linux/unix programs without major modifications to
the source (for example IPchains)?
I was gonna install Linux to act as firewall/router/server but I’m
considering QNX now as it has come a long way since those initial Demo
floppydisks from 1995 something… ;>

Thanks