In Starfinder, using a homebrew setting, I had my group encounter a ship that was above their level in order to urge them to run. However, the group decided to go for the route of "If we are going to die we are going to take them with us," and rammed the enemy ship before escaping to the pods. The pods landed on a planet with primitive people, and the group is planning to salvage the remains of their ship and settle down on the planet turning it into a base of operations.
Are there any mechanics built in to Starfinder for those who wish to build a colony on a planet?
No, there isn't
As for this date, there are no published rules, or 3rd party that I have heard of, that introduces any rules for building bases. However, I had this discussion with a community member of the Starfinder RPG discord server, where the group was a rebel group using stealth tactics to undermine a stronger enemy with starfighters and a base of operations to return and rest, which is a cool idea for a star wars rebellion-type game.
The idea we came up with was to split the party's BP with a few smaller ships, which would require the GM to also balance combats accordingly or they would get stomped by enemies using bigger ships, and use part of that BP to build the non-combat ship accessories for their base of operations, like med bay, engineering, and science lab.
Of course, since they won't have ships, the BP could be spent entirely on their base/colony.
I also suggested that he would look at the downtime rules for Pathfinder to gather ideas from, but considering the theme and a complete difference in currency, we can't just use that system without heavy modifications. The main differences here would be on the currency and flavor of buildings and teams.
A proper scale, at least for the early levels would be to consider every gp as 100 credits. So, a day working to get labor or goods would cost about 100 credits, and produce enough capital that is worth about 200 credits.
This would allow them to build several structures, hire teams to do particular jobs and they would be able to handle the currency generated so they could invest on new structures or building new gear, probably building the necessary so they can fly out of the planet.
Kingdom Building rules
A lot of things in the Kingdom Building system have to be discarded, and the remaining will have to be modified. In concept it may sound easy, the general idea is easy, but the execution would take you a lot of time and they will be playing a different game, much better suited in the rules for a Pathfinder game using the Technology Guide and Starfinder as inspiration and conversion ideas.
The kingdom roles will have to be changed, as they are written with a monarchy in mind, which isn't well suited for a sci-fi setting, as even modern monarchies are different. Hexes become irrelevant with highspeed travels, as bikes and cars are nearly as fast as airships. Loyalty become irrelevant, people really have no loyalty to their leaders, but that stat could be renamed to Satisfaction or Happiness without a lot of issues. With no hexes, you need a new form of controlling the DC. The DCs and skill scaling are different in Starfinder and you will have to create a scaling DC table similar to the one found in Pathfinder 2e. "Science" or "Technology", to me, are just as important as Economy in a sci-fi setting, so you would have to come up with a new kingdom stat, which would require adjustments on the kingdom stats too.
The kingdom building rules are intended to work with multiple hexes and settlements, and while they work for a single settlement (a colony), they will be limiting themselves to a fraction of that system's potential.
I didn't even get into the buildings and I see myself writing a civilization/endless space adaptation to Starfinder before this is done. But don't take this as un-motivation, because if that was what my players wanted, that would be exactly what I would do, even if it took me a few days of tinkering and tweaking of those rules.