GO to your site in office 365 page click on share point on the side menu
Then Click on the create site button on the top of the page
Now You will have to enter the site name and site url on the menu
After that you will have to create subsite and create master page for the Site collection
Click On site Contents on the Share point page you have created
Search for the new subsite button on site contents page and then click it
Once You have clicked on the page you have to fill up this form
Then you will land on a page that look like this
Goto Site Settings on the menu this page will open up look for manage site features under Site Actions
Search for SharePoint server publish on the page and activate it .
Now Go back to Site Settings and Select master page and page layouts in web designers Galleries
Click on files new new document you will be given a set of option click on master page for creating master page and click on Page layouts for creating Page layouts
After you have created the master page and page layouts
Go to Master Page on the Look and feel select the master page you have created on the this page
Thats it You have Success fully created a master page and connected it with the site collection.