Black holes in galaxies: Environmental impact on gravitational-wave generation and propagation