You can merge both a profitable entity with an entity that has a Net Operating Loss assuming that both entities have common ownership or sufficient overlap and a limited history of owner shifts. The Net Operating Loss of the dissolved entity can be utilized for the surviving entity according to Section 381 of the Internal Revenue Code assuming that the merger is a tax free Type A reorganization.
However matters involving NOLs are often more complicated than you’d expect. There may be some limitations on the use of the NOLs under IRC 384 which you may have to take into consideration depending on your future plans. The bottom line is that you need to either come up to speed on treatment of NOL’s according to the Internal Revenue Code or engage an expert to render an opinion before entering into any transaction.