Heavy rains that caused a dam to overflow in southwestern Nigeria and led to houses being submerged has killed 20 people and displaced thousands, an emergency management agency spokesman said on Sunday.