Not sure whether it should be available in O365 or not. However, you can check if it exists in Site Content Types. If it is available there, you can add it to Master page gallery List content type.
You need to add to the Master page gallery content types
Click on Library settings-->Advanced settings-->Check Allow management of content types
Now you upload the .js file or edit the the item, you should able to see the Java Script Display template content type in drop down.