I have two layers. Layer 1 contains points (x,y) and layer 2 contains one polygon. All points in layer 1 are positioned within the polygon of layer 2. The points in layer 1 contain an attribute with information on the topography/elevation at the specific point. Can I color the polygon in layer 2 based on attributes from the points in layer 1 in order to create an elevation map?
If joining the layers is an option I suggest to go the processing toolbar and there under QGIS geoalgorithms -> Vector general tools and there use the tool "Join attributes by location"
As you can see in the Screenshot it takes several inputs so if every Polygone just contains one point you could stick with the option "Take the attributes of first ... " if not you could use the statistics. The tool will create a new layer, however. The Target layer would be your polygon layer while the points layer would be the joining layer.
Afterward just style the newly created layer with the elevation as classification value
The only option I can think of is to generate a raster elevation model from the point layer, then clip that resulting raster with the polygon layer so that any cell outside of the polygon boundary are NODATA. Then you can display the raster with the polygon outline above it.