The iPhone 7 and iPhone 8 use different battery connectors. The iPhone 7 and 6s use the same connector but the cables are different lengths and it causes the battery percentage to be wrong. You can test an iPhone 7 with a 6s battery though. The iPhone X and 8 plus have the same battery connector also, although I don’t know if it will supply enough power to turn on either one. In short, no, iPhone 7 and 8 batteries are NOT interchangeable.