Actually they said the first arrived on the planet 300 years before the film took place. Which again I stress means they lived their before there was a United Federation of Planets.
When the United State acquired the Louisiana territory, it included the city of New Orleans.
This was in the year 1803.
Likely there were people in New Orleans who had lived in the city prior to the formation of the United States some 27 years before.
In 1803 New Orleans became part of the United States.
You keep bringing up how the Baku arrived on the planet prior to the formation of the Federation, but you fail to explain how this means the the planet can't be a part of the Federation. "They were there first." doesn't preclude the planet the Baku are living on becoming a part of the Federation at some point after they arrived.