All of the answers above are wrong, unfortunately.
There is common confusion, when talking of consonance and dissonance, between cultural aesthetics vs objective harmony.
Maximal consonance is equivalence, at all factors of two of a given fundamental within discriminable range - which is about 8 octaves for most people (although our range is usually quoted as 10 octaves from ~20Hz to ~20kHz, the upper two are actually pitch ambiguous, because they're only sensed by lower-tuned hair cells, which are only specialised up to about 5kHz).
The 1:1 unison cannot strictly be regarded in terms of harmonic consonance and dissonance, since it is an interval of zero - it only has amplitude relationships, not a wavelength relationship; perhaps cancelling, or adding 2db, at the other extreme, but it does not belong in the realm of harmonic properties, since it has none. It's just the same frequency, overlaid, perhaps with up to an 180° phase offset. But that's nothing to do with "harmonic" interplay, which by definition denotes a property between two or more distinct tones that is purely emergent, and not a property of the individual constituent stimuli. To wit, "tonal harmony" concerns the properties of non-zero intervals!
The first interval being composed of two discrete frequencies in consonance is the octave, at 2:1, followed by all further factors of two of that fundamental. Thus, what we've been calling "consonance" is actually instead this paradoxical property of equivalence.
Dissonance is just its absence.
All further consonances and dissonances are but degrees of inequivalence.
The most consonant intervals are those resolving to the smallest temporal integration windows - those tones whose differing wavelength cycles repeat together most regularly. Hence, 2:1 resolves every alternate cycle of the upper tone, 3:2 every third, 4:3 every fourth, and so forth.
Dissonance is not caused by 'beating' - pure tone octaves still sound equivalent, and thus remain maximally consonant, and while pure tone fifths beat noticeably, 3:2 is still the second most consonant (or rather, 'least different') interval after the octave.
The octave is primal because it is the simplest frequency ratio possible - all other intervals are by definition more complex, and thus resolve less frequently.
This matter has nothing whatsoever to do with taste, culture or any subjective factor - it's a cross-species, universally consist property of mind. There is no harmonic consonance and dissonance - only sameness and difference - or, more accurately, degrees of difference, against an objective baseline of "zero difference", AKA equivalence.
Cultural aesthetic, style and taste are certainly subjective, but shouldn't be described in terms of consonance and dissonance if these words are to have rigorous definitions for objective tonal properties.
And even then, strictly speaking, consonance and dissonance shouldn't be so named themselves - there's only equivalence, and its magnitude, which peaks at factor-of-two synchrony. Tritones are just not very equivalent.
Unlike consonance, dissonance has no maximum value, because it's infinitely variable - a signal may be infinitely complex (regardless of its actual information content of course). But it may only be finitely simple, and this simplicity converges to 2:1 equivalence.
This is all perfectly empirical and verifiable by anyone. It's so simple, there is no mystery. None of the rote learners are thinking in clear terms on this issue. This sticks in my craw as this is obviously important stuff - 'equivalence and difference' whatever it actually is, is telling us something significant about how we assign value to information resolved via frequency analysis processes.. in other words it's also the stuff of language and higher thought, besides everything else... an objective "zero point" of "no difference" at all factors of two throughout our psyche.
Specifically, we hear discrete tones - higher and lower, yet the relationship between them - their harmonic sonority - registers as "no difference".
"Equal". "Same". "No difference". It is a value of metadata. A value we assign. It is internal, not external (the tones themselves, the stimuli, are by definition different pitches) - octaves touch a nerve for us. An informational zero point for meta-data, against which we're evaluating and encoding all the auditory information we process.
That, my friends, is what consonance is. It correlates to thermogeometric equillibria in a randomly self-organising network; an informational ground state, of minimal entropy.
Cultural aesthetic is "anything goes" - with the single reservation that all tonal systems must be derived from subdividing the octave, even without the progenitor being aware of the fact. Octaves can only sound equivalent, to everyone. Everything else is simply a matter of taste and refinement, but shouldn't be conflated with harmonic consonance and dissonance (such that they are).