The term 'foundation' is used in two ways here:
Firstly, in v49, the term is used to refer to the immovable rock that lies beneath the surface of the earth. This rock is here used in contrast to the movable 'earth', upon which a man seeks to build a house. The earth is akin to the clay, or sand, as Matthew mentions in his similar account, cf. Matthew 7:26: And every one that heareth these sayings of mine, and doeth them not, shall be likened unto a foolish man, which built his house upon the sand. The earth has no strength or ability to hold up the structure built upon it. There is the rock, and there is the sand, upon which the whole structure can be built. Only the house built upon the rock will stand.
Christ Jesus is this rock upon which the whole edifice of the Church is built. He is 'Petra', the rock.
Secondly, in v48 the term is used to refer to the foundation that is laid down by the builder. Even today we speak about builders 'laying a foundation'. This foundation needs to be laid upon solid ground or it too will give way eventually. The builder, in this illustration in Luke's Gospel, lays his foundation on a rock. The house he subsequently builds upon the rock will stand.
In ancient times builders used large stones for this 'foundation' that they would lay down. Many ancient buildings have massive 'foundation stones'. This was part of the wonder of the Temple, to which the disciples drew the Saviour's attention, cf. Matthew 28:1; Mark 13:1; Luke 21:5. Some of these stones were estimated at around 20 metres in length. The 'cornerstone' within this element of the 'foundation' was vitally important, as structurally these 'cornerstones' carried so much of the weight of the building.
From Scripture we learn that Jesus Christ is again part of this foundation. He is the chief cornerstone, cf. 1 Peter 2:6: Wherefore also it is contained in the scripture, Behold, I lay in Sion a chief corner stone, elect, precious: and he that believeth on him shall not be confounded. A quotation taken from Isaiah 28:16.