Dams have been built for thousands of years; some have failed causing disastrous floods. Many of these dam failures were caused by particular geological characteristics of the soils and rocks at the dam site. The birth of engineering geology as a separate specialist profession is often said to date from the failure of the St. Francis Dam in the U.S.A. in 1928.
Today engineering geologists are routinely employed to carry out investigations for all types of civil and mining engineering construction projects. The purpose of most engineering geology work is to try to ensure that a proposed structure is built for the lowest cost consistent with currently accepted safety standards. Accepted standards of safety may, and usually do, change with time. What was acceptable 50 years ago may not be acceptable today.
A good starting point for researching dams on the Internet is the Wikipedia Dam page.