I'm assuming you removed the plaster and are left with the slats. As long as the slats are flat, and you use screws or nails that are long enough to reach firmly into the studs, you should be OK. Make sure you secure to the studs and not just the slats. You will probably end up closer to the original wall thickness this way. It will save you adjusting your jambs and outlet boxes.