ask a hardware store if they sell "lye" (plumbing/pipe cleaning chems, usually) (red devil is one popular brand)... & as for "legality" of extracting (or even chug-a-lugging) DXM ---> most OTC medicines have a blurb: it is a violation of federal law to consume this products other than as indicated on package" (or something like that - you get the idea...)
Well, you can legally buy phamecuitical DXM without a script, so it's probably legal. grocery stores all sell lye.
Haven't seen that one on OTC medicines yet. They have a warning with that type of wording on consumer insecticides and disinfectants, though. On the original subject, be VERY CAREFUL when working with NaOH. When dissolved in water, the liquid gets very hot, even to the point of boiling. Boiling lye is NOT something that you want splashing on your skin or eyes! Gloves and goggles would be the way to go....
they sell it as red devil glass door cleaner for wood stoves at most stores, especially fireplace/woodstove related stores. does not list molarity though.