From what I have learned so far, East and West Germany seemed to allow the free passage of any citizens to and from each Germany before the wall was built. Was this because they had good relations at the time? or was it simply because they never saw the emigration from East Germany as a problem?
Both East Germany and West Germany sought to represent Germany as a whole and did not recognise each other until the 1970s.
Essentially East Germany claimed to be the one true Germany, the people living in "West Germany" were under "imperialist opression" and would soon become enlightened and join the "progressive socialist movement" and the Soviet-controlled puppet regime in East Germany would take over for all of Germany. The East German national anthem spelled it out: "Raise from the ashes, turn towards the future, we will serve in good cause, Germany united fatherland!"
But the USA and Britain had no interest in seeing all of Germany under Soviet rule, so they supported the West German government. The West German government also sought to reunite Germany, but not at the price of falling under Soviet rule. Instead, they wanted East Germany to join their government, a proposal that was vehemently opposed by Stalin and later Soviet leaders.
The West German constitution pre-1990 even had a special clause that the Grundgesetz (Basic Law) was provisional and that a full consitution would be created when Germany would be reunited again.
(West) German citizenship law considers all people of direct German descent citizens, so East Germans who moved to West Germany automatically became West German citizens. This made it relatively easy to move to West Germany for East Germans before the wall was built.
East Germany actively encouraged people from West Germany to move to East Germany. One move they did fairly early (first half of 1950s) was to make higher schooling free and give out scholarships to students from a working class background, something that did not happen in Western Germany until about 20 years later. This attracted young people interested in a higher education.
And no, the countries did not have good relations at the time, but they competed with each other in which country was the better one, which country could attract the most skilled workers, which had the better economy and better living conditions for its people, etc.
West Germans did not see immigration from East Germany as a problem bc the majority were young, well educated people in their 20s to 40s. They came at the height of the Wirtschaftswunder in the 1950s when the West Germany economy was booming and skilled workers were in high demand.
The West German security forces did see a security problem, how did you make sure the person who moved from East Germany was not an East German spy? The West German security agents checked up on everybody because of this, but ultimatively they could not hinder German citizens from free movement.
However, the mass emigration was a serious problem for the East German economy. They had to stop people leaving or risk collapse of the whole system. That prompted the erection of the Berlin Wall.