The equivalent to a 'master page' in Confluence is a Theme. You can read more about themes here: https://confluence.atlassian.com/display/DOC/Working+with+Themes
Custom themes can be written by developing a custom Confluence plugin. The underlying technology used is Apache Velocity templates rendered using SiteMesh.
If you want to learn how to create a new theme plugin, here's some places where you can get started:
- Creating a Theme (User documentation)
- Writing a Confluence Theme (Developer documentation)
- Creating a Theme (Developer documentation)
- Creating a Stylesheet Theme (Developer documentation)
- Confluence Theming 101 (Slides from a technical presentation)
Overall I would say that the technical complexity of developing a Confluence theme is significantly higher than customising an ASP.NET master page. In ASP.NET, you are just working with the bare framework and the rendering engine, but in Confluence you have to contend with two different open source technologies, plus Confluence's own idiosyncratic plugin system. You should expect to have to invest some time in overcoming the learning curve before feeling competent at building them.