Most probably the number thirty eight was chosen to mark the debut of Superman in the year of 1938.
Superman debuted this season in Arrowverse. So, to associate it with the debut of the Golden age Superman, Earth 38 was chosen.
Also, in this very Earth 38, Supergirl takes the name of Kara in her civilian life (nothing new and non-typical).
As Wikia writes at the outsets:
Home to a Superman that debuted in 1938 and a Batman that first appeared in 1939. ...
And its continuation in Earth-3839:
Earth-3839 is a reality in which Superman and Batman started their careers in the 1930s, and started families that would follow in their superhero footsteps all the way to the 30th Century.
Also, summing up the post with the CINEMA BLEND article:
[...] I'm not sure how the folks at The CW chose 38 as the number for the Supergirl universe, but it could be a nod to the fact Superman made his comic book debut in 1938 as the first major superhero. ... Supergirl wouldn't exist without Superman, so Earth-38 could be a solid way to honor the superhero who started it all.
Albeit it's a speculation, I deem it as a reasonable explanation as to why they chose 38.