How android ROMS based on TouchWiz work if TouchWiz source code is not available as opensource? Source code of samsung-touchwiz is not available to public to download and use. But there are custom roms which have touchwiz UI available .How do touch-wiz based roms like Salman rom work  without having samsung touch-wiz code?
Samsung allegedly releases the kernel sources, allowing a developer to customize and compile a kernel. Since they can also download the binary ROM (or copy it from their device), they can use their kernel as a drop-in replacement in the TouchWiz ROM--providing their changes didn't break the communication with the drivers. They normally don't touch the drivers or the userland apps, just the kernel. 

Alternatively a user can tweak the default ROM by adding apps and/or themes ('kitchen work'). This has little real value to consumers and is not considered original development.