Alliteration is just repeated similar sounds. Unlike a rhyme, it doesn’t have to be the ending of the sound or the ending of a line.
Good alliterations are like good puns - the more obviously intentional, the better it is. A repetition in just two words would still qualify as alliteration for me, but it would not be a good alliteration, and I might right it off as being accidental.