A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi Mina,
Yes, you can do this via changing the coding of SharePoint master page by using SharePoint Designer. Here is a article for your reference:
Link Your Site Logo to Your Root Homepage In SharePoint 2013
Since the question is related to how to customize the master page, if you encounter any problem, we suggest you go to our MSDN forum for the expert assistance.
We appreciate your understanding.
Tisky