In 1941 he was deported to the Łódź Ghetto and subsequently to concentration camps in Auschwitz and Dachau. In May 1945 after escaping from Dachau, he was made a leader of the Garmisch-Partenkirchen camp for the war refugees. After returning to Prague in June 1945 together with Jarmila Čapková Margolius went to Bergen-Belsen to search for Josef Čapek. In December 1945 he joined the Czechoslovak Communist Party influenced by his war experiences and murder of his parents and relatives in the concentration camps and hope of instituting better future for the country. Between 1945 and 1948 he worked for the Central Federation of Czechoslovak Industry in Prague. Afterwards he was promoted to the Chief of Staff of the Minister for Foreign Trade (1948–49) and subsequently became Deputy Minister for Foreign Trade responsible for the sector trading with Western countries (1949–52). Together with his colleague, Evžen Löbl, Margolius was the author of dollar offensive in the Czechoslovak economic policy. In 1949 in London Margolius negotiated and signed several important economic and financial agreements with Ernest Bevin and Sir William Strang who represented the British Government. The agreements through Margolius' effort were weighted in favour of the Czechoslovak trade rather than the British trade. Czechoslovak government was satisfied with the outcome of the negotiations and requested that the effort of all those who had participated would be appreciated. Margolius was a lawyer and economist and was not directly involved in the contemporary Communist Party machinations or politics.