Alliteration is a poetic device, not a figure of speech.
A poetic device is a way of using words to create meaning. Poets often use words differently than prose writers do, but these can be found in any writing.
Alliteration is the repetition of initial consonant sounds. Consider “the sunny sidewalk started sideways from my house” where the s sound is repeated.
A figure of speech is a type of poetic device. For example, a simile or metaphor is figurative language. We usually use figure of speech to refer to an idiom, or a commonly used figurative phrase. For example, “the cat’s out of the bag” or “crazy as bedbugs” are idioms. A simile is a new example of figurative language, such as “her eyes were as blue as sapphires.” If “the sun was laughing” that would be a metaphor.