2. As the old saying goes, "The articles in the world are copied, see if you can copy them". In fact, your graduation thesis was really written on the basis of quoting and drawing lessons from other predecessors' papers.
According to your specific situation, it is still a little risky to pass the customs smoothly. There are two main risks: 1) whether the topic of your friend's thesis meets your graduation requirements; 2) Whether your friend's paper has been published or online, if the examiner has seen it, you are finished.
4. In combination with the reality, I personally give you some suggestions: on the basis of the main content of your friend's paper, adjust some frameworks, such as switching the first part and the third part, or slightly modifying terms, and then adding some examples in combination with your own work or interests. So if the examiner asks questions, you can have examples to prove that the general defense is no problem.
I hope it helps you.