Improvisation has played a role in virtually all musical genres, from the classics to jazz and rock. It is closely aligned with composition.
Music is first and foremost a spontaneous activity of self-expression. Therefore improvisation has played a role in almost all musical forms.