Lime substitute for nixtamalizing corn
At least in theory what you're proposing should work, however I wouldn't mix sodium hydroxide, calcium chloride, water and corn all in one pot as you seem to be suggesting. I'm not chemistry expert, but as I understand it sodium hydroxide and calcium chloride react easily when dissolved in water to form calcium hydroxide and sodium chloride. Having corn in the mix won't help the process so you'd be better off doing it as a separate step. Since calcium hydroxide doesn't dissolve in water very well, most of it will precipitate out making it fairly easy to separate out. Doing it this way you can make sure the sodium hydroxide doesn't end up reacting with the corn instead of the calcium chloride.

However making calcium chloride a home is something I've never tried myself, and I doubt anyone else here has either. There could easily be important considerations that I'm not aware of.
So it probably would be a good idea to ask on Chemistry Stack Exchange about how to best go about producing calcium hydroxide from sodium hydroxide and calcium chloride. That is, assuming such a question is on-topic there, though from a quick check it looks like it should be.

There is however one important consideration that I can mention, one that I'm sure you already aware of, and that's the fact sodium hydroxide (aka caustic soda) is a pretty dangerous chemical. For that reason alone, I think Rick's answer is the correct one. Just buy food grade calcium hydroxide. When sold as pickling lime it's not at all hard to find online. During the fall you might be able it in local stores sold along with other seasonal canning-related goods. Another possible local source might be an aquarium store or club, as food grade calcium hydroxide is apparently used by aquarium owners as a cheaper substitute for aquarium specific products.