Ultimately either term is referring to oligonucleotide sequences used to tag a fragment/sample being sequenced.
I consider Illumina P7 and P5 oligos to be tagged with
index sequence. These index sequences are smaller. They are always sequenced independent of the main reads (R1/R2) in Illumina technology.
Barcodes on the other hand can be custom sequences (of any length and significantly more diversity) that a bench scientist introduces into fragment being sequenced (by using custom oligos/PCR primers etc). They will generally be at the beginning (5' end) of the read so they get sequenced reliably in every fragment each time.
Some people do use these terms interchangeably but above should differentiate their practical use.