In the POSIX toolchest, for positive integers only, you can use awk:
awk -v min=5 -v max=10 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
Do not use that as a source to generate passwords or secret data for instance, as with most awk implementations, the number can easily be guessed based on the time that command was run.
With many awk implementations, that command run twice within the same second will generally give you the same output.
If min (and possibly max) may be negative, you'd need to change it to something like:
awk -v min=-2 -v max=1 '
BEGIN{
srand()
x = min + rand() * (max - min + 1)
x -= x < 0
print int(x)
}'
To work around the fact that int(x) truncates the decimal part instead of giving you the largest integer not greater than x (and awk doesn't have floor()).