"The Soldier" is full of alliteration. Overall, this is a very pretty-sounding and lyrical poem. The speaker presents a vision of war and death that is completely relieved by the bond he feels with his home country. The sound of the poem is suitably pleasant. That is, the sounds ring together in a way that is pleasing on the ear, avoiding any harshness that might suggest anything negative. The alliteration is an important part of this overall approach.
Appropriately enough, alliteration is first used from the very beginning. Across lines 1 to 3, the poem uses /th/ and /f/ sounds:
If I should die, think only this of me:
That there’s some corner of a foreign field
That is for ever England.
These sounds don't really convey anything in particular other than contributing to the overall pleasantness described in the paragraph above. Additionally, although it's not strictly alliterative, the repeating letter "e" in the phrase "for ever England" chimes with this sentence's musicality. Additionally, the two /f/ sounds create a pair that contrasts with "ever England," setting up the opposition between the foreign land and the home nation.
Next, in line 4, "rich" alliterates with "richer" (this repetition is also an example of diacope and polyptoton). The line itself becomes rich in the /r/ sound, thus adding to the poem's abundance of musicality.
Lines 7 to 8 are full of /b/ alliteration. These lines paint a pastoral and idyllic picture of England which ultimately makes the country sound like Eden. The repeated sounds have a pretty and luxurious effect:
A body of England’s, breathing English air,
Washed by the rivers, blest by suns of home.
Line 12 uses /h/ and /s/ alliteration:
Her sights and sounds; dreams happy as her day
The /h/ sounds give the line an impassioned, breathless quality, while the /s/ contributes to the overall prettiness of the poem. The /l/ alliteration of the following line—"laughter, learnt of friends"—works in a similar way.
So, throughout the poem, alliteration adds to the lyrical richness of the poem, which captures the speaker's intense, patriotic love for England.