X is your sponsor and you are working with company Y. Y wants NOC from company X but company X does not want to give NOC.your question is, if company Y terminates you, whom you can ask for a NOC company X or company Y? for me, it should be X because he is your sponsor but company X does not want to give NOC because you are not working with them instead you are working with company Y. if that is the case, if any one of the company terminates you, you will not receive a NOC either of the 2 company. that means its your lost.