You need to include MatDialog Module in the imports.
import {MatDialogModule} from '@angular/material';
@NgModule({
imports :[MatDialogModule],
...
})
Edit 2022
You need to include MatDialog Module in the imports.
import {MatDialogModule} from '@angular/material/dialog';
@NgModule({
imports :[MatDialogModule],
...
})