You can view chm files with xchm or similar programs, you can extract them with
this, but I can't find anything on how to create them. I believe chm is a proprietary format by Microsoft. Therefore, unless someone does some work cracking the format to see how it's built, I doubt you can do that. If you wish to install Windows to do it, there are ways.