Your concerns are a bit misplaced, though you should have concerns. Plagiarism is using other people's words and maybe ideas without attribution. Speaking "their words as if they were your own."
Copyright comes in to play when using other people's words, of course, though copyright law is a mess and varies from place to place. But if you quote and attribute the earlier work appropriately you won't be in the wrong here.
But note that copyright applies to words (pictures,...), not to ideas. While I can't publish images of Mickey Mouse, I can certainly discuss the "idea" of Mickey Mouse without ethical or legal concerns.
Patent law is a bit different and allows the exclusive use of "ideas" of certain kinds for a fixed period. But that doesn't apply here.
However, to have an acceptable dissertation, you need to do something that is considered novel by (at least) those who review it at your university. Simply repeating earlier work isn't new, though it may be that you use new techniques, or come to a different conclusion. Some research can invalidate older work, and, especially when it uses better techniques than the original, is certainly valid and worth publishing.
If what you do is truly different then you have the basis for a dissertation. If it is a little bit different, you probably don't. But ethics would only be involved if you copy and present the copy as your own.
It may be an apocryphal story, but Picasso is said to have said "Good artists borrow. Great artists steal." The same sort of thing has been said of "writers", "physicists", etc. But in the case of art, no one would accuse Picasso of presenting the work of another as his own, though he did steal ideas from other artists.
Build your work on the ideas of others. But make it clear what is yours and what is "theirs."
However, another problem that might apply here is the problem of parallel work. If you work in parallel with someone else but don't know that until late in your studies, you may wind up in a situation in which your work must be discarded. There have been exceptions to this, but they are rare. If you didn't know, but should have known, you are just out of luck. However, it has happened that dissertations have been submitted by people unknown to each other more or less simultaneously. This will generally cause, at least, an investigation. That doesn't seem to be the case here, but you may be in a situation in which the other person just reached the finish line first.
The reason for that is that "ideas are free" and what I can learn, you can learn. The thoughts I can have, you can also have. The insights might be shared, etc. But if you are a bit quicker to the end than me, then you have a dissertation and I don't. Not especially frequent, but it happens.