How is it possible that the melody he composes is identical to the melody in Prometheus (2012)'s theme soundtrack (song name Life)?
Actually, we should turn that question around: why do you think it's impossible?
If there is no proof of something being impossible, then it must logically be possible. Please do note that "possible" does not mean the same thing as "likely" or "expected".
Many stories revolve around the fact that something possible-but-improbable happens. Some random examples:
- Someone shoots a bullet, it deflects and bounces around and ends up killing the shooter. That is obviously a one-in-a-million shot, but it would be wrong to say that it is impossible to ever happen.
- A hero jumps out of a moving vehicle (at high speed). It's very likely that he gets hurt. However, it's not impossible that he manages to walk away from it. It's just very unlikely.
It would be wrong to call these plot holes or movie mistakes. It would only be a movie mistake if you can prove that it couldn't have happened (= proving that it is impossible).
E.g. the bullet reflected off of a piece of paper (impossible!), or the hero jumped out of a car and smacked face first into a concrete wall (impossible to walk that off!)
A bit more specific to your case, I can think of another example.
In Battlestar Galactica (the 2003 remake), Anders suddenly remembers a song that he himself had written. This song is "All Along The Watchtower", released by Bob Dylan and covered many times, most notably by Jimi Hendrix. However, there is no relation between the in-universe song and the out-of-universe song.
The song's out-of-universe existence does not impact the plot in any way.
However, BSG's premise heavily relies on the implication that "all of this has happened, and will happen again" (it might be slightly different the next time, but it boils down to the same principle).
Because All Along The Watchtower has been covered so many times; you can see the same premise occur in that song: it has been repeated many times, with slightly different version, but it ends up being the same song with the same lyrics.
That is a thematical connection that has no bearing on the in-universe plot, it is merely an easter egg for the viewers.
The same seems to be true for Alien Covenant. This song is original in-universe, even though it isn't original out-of-universe. The fact that it isn't original out-of-universe has zero impact on the plot, and is therefore irrelevant in-universe.
Unless a connection is made between the two, there is no reason to assume that this is done for any reason other than an easter egg or quick nod to the viewers.
If I extend the principle behind your question, I can show you some clear examples why your question's implied logic is inherently flawed:
- How is it possible that people in Middle Earth have swords, when Middle Earth is not our world?
- How is it possible that Let It Go is popular on Spotify, when it is originally sung by a fictional character in a movie?
The answer to these examples is the same as your question:
Just because one of the universes (fictional/real) has done something, doesn't make it impossible for the other universe (real/fictional) to do the same thing for a completely different and unrelated reason.