The Scots-born MP for Bradford West, who was expelled from Tony Blair's Labour Party in 2003, said he would prefer "a real Labour prime minister of the whole of Britain", but said he would "fancy being prime minister of Scotland" if it votes for independence on September 18.
Mr Galloway was in Edinburgh for the latest date in his "Just Saw Naw" speaking tour.
His appearance was met by rival protests by the left-wing Radical Independence group, which opposes his pro-Union stance, and the right-wing Scottish Defence League, which opposes his links with religious minorities.
The two sides were held apart by police outside Edinburgh's Assembly Rooms, with Radical Independence taunting the SDL with "Nae Nazis" chants, and the SDL calling Mr Galloway "a traitor".
Speaking ahead of his appearance, Mr Galloway said: "I would fancy being prime minister of Scotland but I would rather we had a real Labour prime minister of the whole of Britain.
"I want to avoid the break-up of the country, which I think will beggar people on both sides of the border, will lead to permanent Tory rule in Westminster and thus the Bank of England, which will control the Scottish economy.
"Unleashed will be a race to the bottom with England cutting taxes, regulation, public spending, and Scotland having to follow it. So everyone on both sides of the border will be worse off."
Mr Galloway said he believes in "united countries" including a united Ireland, saying he would support Northern Ireland's exit from the UK, in contrast to his bid to prevent Scotland from leaving.
"I don't believe in breaking countries up as I think we have too many countries in the world, not too few," he said.
"The Irish people were denied their right to unity and independence. The Scottish people never have been, and could have voted for independence at any time that they liked in the whole era of universal suffrage of nearly 100 years.
"People say that they want Scotland to have self-determination but they have self-determination, and always have, and will exercise that self-determination again in September."
He said he would contemplate becoming an MP of an independent Scottish Parliament in the "hypothetical" event of Yes vote.
He added: "I am confident that the vote will be No, and I just want to make sure that it's a decisive result because otherwise the kind of hatred and division that this campaign is at risk of sowing will be a permanent feature of Scottish politics and public life."