Can I extend an AC adapter with 18/2 thermostat wire?
Yes you can extend the DC side with that wire, the short extra length isn't going to cause any problems. From a building code point, you probably don't want to run it inside the wall like that, your insurance wouldn't like it of a fire happens, cya and all. If your going to do that just have a legal outlet installed.