The Ka'bah was originally built by Ibrahim (Abraham, AS) and his son Isma'il (Ishmael, AS). This is explicitly stated in the Qur'an in Surah Al-Baqarah (2:127): "And [mention] when Ibrahim was raising the foundations of the House and [with him] Isma'il, [saying], 'Our Lord, accept [this] from us. Indeed, You are the Hearing, the Knowing.'"
The Ka'bah, located in Makkah (Mecca), is the most sacred site in Islam and serves as the qiblah (direction of prayer) for Muslims worldwide. According to Islamic tradition, Allah commanded Ibrahim to travel to the barren valley of Makkah, where he had earlier left Hajar and the infant Isma'il. Father and son together raised the walls of the Ka'bah as a house of worship dedicated solely to Allah.
After completing the construction, Ibrahim (AS) was commanded to call people to perform Hajj (pilgrimage) to the Ka'bah, as stated in Surah Al-Hajj (22:26-27). The Ka'bah has remained the spiritual centre of Islam ever since, and the annual Hajj pilgrimage retraces many of the actions of Ibrahim, Hajar, and Isma'il.
The other pairs listed - Dawud and Sulaiman, Musa and Harun, Isa and Zakariyyah - are not associated with the building of the Ka'bah.