Can teflon tape be used on a threaded joint behind a wall?
I would examine why the pipe was corroded. Was it a galvanic failure caused by joining copper/brass to galvanized steel? 

Remove the fitting entirely and inspect/clean the threading. If the threading is damaged then replace the valve... In fact, you could replace the valves anyway if they're old and you've got the wall off. Many modern valves have replaceable cartridges that can be swapped when they wear out rather than having to replace the entire valve.

But onto your actual question: Teflon tape will be fine if used properly (wrapped in the right direction, not torn, etc). You may consider using high-density tape.
For in-wall pipes I like to use pipe dope instead. Depending on the nature of the joint (and especially if it's between plastic and metal or two dissimilar but non-reactive! metals) you can use both:
Tape first, then put dope on top of the tape. For fittings, both plastic and brass can change shape easily....the threading/tightening can change the shape so the tape fills voids in the threads and the dope seals it.