Bremsstrahlung emission of photons during nuclear reactions inside dense stellar medium is investigated in the paper. For that, a new model of nucleus is developed, where nuclear forces combine nucleons as bound system in dependence on deep location inside compact star. A polytropic model of stars at index $n=3$ with densities characterized from white dwarf to neutron star is used. Bremsstrahlung formalism and calculations are well tested on existed experimental information for scattering of protons of light nuclei in Earth. We find the following. (1) In neutron stars a phenomenon of dissociation of nucleus is observed --- its disintegration on individual nucleons, starting from some critical distance between this nucleus and center of star with high density. We do not observe such a phenomenon in white dwarfs. (2) In the white dwarfs, influence of stellar medium imperceptibly affects on bremsstrahlung photons. Also, we have accurate description of bremsstrahlung photons in nuclear reactions in Sun. (3) For neutron stars, influence of stellar medium is essentially more intensive and it crucially changes the bremsstrahlung spectrum. The most intensive emission is from bowel of the star, while the weakest emission is from periphery.