Reference: This passage owes its imagery and vocabulary to Matthew:
Therefore whosoever heareth these sayings of mine, and doeth them, I will liken him unto a wise man, which built his house upon a rock:
And the rain descended, and the floods came, and the winds blew, and beat upon that house; and it fell not: for it was founded upon a rock.
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:
And the rain descended, and the floods came, and the winds blew, and beat upon that house; and it fell: and great was the fall of it. (Matt. 7:24–27)
The Book of Mormon combines images from different verses in Matthew, but the symbol of the rock ties them together. While the vocabulary is certainly Matthean, the concept is not dependent upon the Old World. The Nephites (and many Mesoamericans) would be familiar with the architectural effects of building on rock versus sand.