Who will be the next president of the USA if it indulges in war before transfer of power? Will Biden get the power? Will it be right to exchange power during war?
Barring some extremely unlikely turn of events regarding election results Joe Biden will become President of the United States on Jan. 20. Should for some reason Biden die or otherwise become incapacitated before Jan. 20, then Kamala Harris will be POTUS. Nothing else short of a coup the United States would change that transition of power.
If I understand your question your asking if the USA declared war on another country would that prevent the transition of power to Joe Biden?
If that is your question then the answer is no. No where in the constitution does it say anything about the transition of power being different during war time, nor has there been any laws or other precedent of delaying transition of power due to being in war. In fact there is plenty of precedent for a peaceful transitions to new presidents during war time. To give just one example during World War 2 we actually had 3 presidents, though one was a former vice president who became president after the death of the previous president.
For us to actually declare war Congress has to sign off on it, which seems highly unlikely. A president can start an 'extended military engagement' without war declaration, as was done in Afghanistan, which wouldn't be an official war, but that just makes it even less plausible that such an action would affect the presidential transition of power.
If nuclear weapons were used that wouldn't change the legal process, however, any war with nuclear weapons would be so devastating that the ability of the government to lead would suffer significantly, if you add that on top of the current political turmoil and the USA may very well be left in a state of near anarchy where the president would struggle to properly lead the nation. Trump would still not be president though, the only question would be how well, if at all, Biden could take office and lead after the devastation that happened. IE nuclear war is bad and should be avoided, Mkay?
There have been some, I'd argue rather pessimistic and unrealistic, claims that the USA would end up in a civil war if Trump refused to leave office, which you may have meant? I would say I believe this is highly unlikely, even if Trump refuses to leave the government will still function and he would be escorted out of office by his former secret service, by force if necessary. However, if that was what you meant in the (highly unlikely) hypothetical situation of some civil war who becomes president would be whoever won the war. Since Biden has the legal authority and won the popular vote one would assume more would back him so the most likely outcome would still be Biden in office, but obviously it's nearly impossible to predict what would happen in such an improbable scenario.