The ear does not care about ratios. Dissonance can be modeled using Plomp and Levelt's curve, which predicts the perceived dissonance of a pair of sine waves. Dissonance is minimum at unison, smoothly increases to a maximum at a narrow interval (dependent on absolute frequency), and smoothly decreases again as the interval increases.
Sethares extended this model to arbitrary sounds by decomposing them into their sine-wave partials with a Fourier transform and then taking an amplitude-weighted average of the predicted dissonance of each pair of partials. If you apply this procedure to intervals using harmonic timbres (timbres composed of partials with frequency an integer multiple of the fundamental frequency), the dissonance curve has minima that happen to be at small integer frequency ratios.
Harmonic timbres are most common in music, but there is an important class of musical instruments that are naturally inharmonic: tuned percussion. Unless substantial effort is put into designing them to approximate harmonic timbres, these sound most consonant when tuned outside small integer ratios. Indonesian gamelan music is a well known example of this. And with synthesized timbres you can have whatever inharmonicity you like, so timbres can be designed to suit any arbitrary tuning system.
Non-technical explanation of Sethares' model:
https://sethares.engr.wisc.edu/consemi.html
Full mathematical details:
https://sethares.engr.wisc.edu/paperspdf/consonance.pdf