"it seems to me like dissonance can be used like a theme for music."
What is the proper understanding of the use of dissonance in composition?
First off, dissonance is the general term for a clash or tension in a single chord or sound, such as one might have playing a half step (minor second) or a tritone (diminished 5th, augmented 4th). Consonance, its opposite, also applies to a single moment in time, and is the general term for a resolved chord like the octave or (opinions vary) the fifth.
The idea of a proper understanding is inherently subjective. As the commenters have pointed out, the question of what dissonance is in general not only doesn't but shouldn't really have a definite answer. It "probably requires a vast historical review" and "varies wildly between different schools and genres." Note that, although the octave is present in music internationally, it is hard to argue the same about other intervals and chords. Dissonance is often what is seldom heard, while consonance is what is natural to the culture, and then there is always the octave.
But, that is not the question you asked: you want to know about dissonance as a theme in music. So the question is interpreted to not be about dissonance internationally, but about dissonance in context.
Every chord is composed of three or sometimes more notes, but one should observe that no matter what chords are heard there is always a way to interpret the chord in the scale. Say I am playing in C major. Western Music Theory notes that the "Tonic" Chord on C is the resolving chord, and the "Subdominant" F leads into the "Dominant" G. So chord progressions like "C, F, G, C" are interpreted as natural paths from the tonic, to the subdominant, to the dominant, resolving to the tonic again.
Dissonance as a theme relies on playing a scale in other ways than the Western musical standard of consonance. Although improper by more strict standards, this allows dissonance to be a theme.
The trick of the theme of dissonance is that you cannot resolve simply, as in going from the dominant to the tonic, in whatever key. Moving from the dominant to the tonic by taking a long complicated chord progression to resolve will give a buffer distance of dissonance before an unexpected partial resolution, which is one difficult way to achieve a dissonant theme. Repeating that same pattern so that it becomes more natural will still give the piece some cohesive nature. One easier way would be to use seventh chords or some jazzier varieties to make the resolution less complete: the tonic is reacher from the dominant, but neither have their way.
Remember that if you play any chord too much, the ear will hear that as the new Tonic and an aural key change will take effect: you will end up resolving unintentionally to a different key.
So dissonance as a theme requires an adept understanding of purposely defying the structure of the key, while introducing an unnatural structure that won't be a complete lack of musical coherence.
As a qualifier, it is generally easier and more praised to play music in Western culture the way the Western standards are set, although that was not your question.