Placing a speaker inside another cabinet will always affect the sound. In-wall speakers are designed for that purpose and bookshelf speakers are not. Will what you want to do work? Yes, so you just have to choose the speakers carefully to get better results, but the sound will be affected to some extent no matter what.