Can I use an external microphone on my iPhone 7 for speakerphone calls?
No, you can't, because Apple doesn't not allow the choice of the sources. Otherwise, with an old iPhone with the 3.5mm jack, you can cover the last ring to avoid the microphone contact. 

Apple source