You cannot put a standard 12-inch rough-in toilet in a 10-inch rough-in. There simply won’t be enough space for the tank to sit against the wall. However, you can put a 10-inch rough-in toilet in a 12-inch rough-in space as long as you don’t mind a two-inch gap between the wall and tank.