Not always.
I took a 14 month old iPhone 7 into the store which wouldn't charge or communicate via the lightning port. In the engineer's words it was "in perfect condition".
They couldn't repair it, wouldn't do anything because I didn't have apple care and the only way to get around it was a new device.
Nice paperweight though