It is...
Min Damage = Damage(Base) + Damage Number of Dice
Max Damage = Damage(Base) + Damage Number of Dice * Damage Sides per Die
In your example...
Min Damage = 20 + 3
Min Damage = 23
Max Damage = 20 + 3 * 6
Max Damage = 38
The reason for this is that dices do not have a side with 0. If you throw X dice then the minimum you can get is X if all dices roll 1.
It is important to note that the reason number of dices exist is that it changes the probability distribution.
If you only use 1 dice then all numbers have an equal probability (like sides on a dice). However if you have multiple dices then you are subjecting the resulting probability density to trials which turns it into a Gaussian around the average. This means that if you have a lot of dice then damage will most likely be near the average and it will be virtually impossible to hit the min and max damage values.
1 dice with 5 sides + 1 base damage (2 to 6)
probability of max damage = 0.2
This is because a dice has a linear probability density distribution with each outcome having the same probability. 5 sides means 1/5. Logically you can think of it as a dice only having 5 outcomes of which all have the same chance.
2 dice with 3 sides + 0 base damage (2 to 6)
probability of max damage = 0.11111111111111111111111111111111
This is because it is subjected to two unconditional probability rolls of 3 sides of a dice. Each dice acts the same as above but getting both is the product of probability of each landing their max rolls. Logically you can think of it from recombinants.
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
As you can see there are now 9 different results despite the same damage range, of which only 1 is the maximum value. On the other hand there are now 3 values for the average (4). This means that you are 3 times as likely to hit for average damage than you are to hit for maximum damage. The distribution of probability density is a Gaussian around the average (like all Gaussians it extends some peak point at the cost of the edges so that the total area under the graph remains 1.0 as it must always get a result).
This is something that is often overlooked by mappers as they do not understand probability theory. If you want an attack with huge damage range (unreliable) you need to use only 1 dice with a lot of sides. The more dices you use, the more reliable the damage will be (higher chance of hitting for damage near the average).
This is a mechanic not simulated in SC2. There random damage is added like a single dice always. For this reason in SC2 you need to use much lower damage ranges to achieve similar reliability to WC3 when multiple dices are used.