You can publish your module if the proprietary software allows this.
In general, the source code of your module or plugin in itself is not derived from the proprietary program. So you hold the copyright for that program, and no one can tell you whether and how it may be published. As you are the copyright holder you may also publish on GitHub. There are two potential problems:
The license of the proprietary program may contractually prevent you from publishing the module.
Inheriting from proprietary classes or interfaces could make your code a derived work. Whether this is a case is a tricky question to which I don't know the answer.
The MIT and BSD licenses are both perfectly fine here. However, some licenses such as the GPL would require the whole system (proprietary software + your module) to be open source, so you wouldn't be able to use the GPL for your module – unless you provide a license exception. Compare the GPL FAQ. But these GPL-specific problems do not apply here.