what is the formula for "dice roll" damage (for example : 2d4 +1)

meaning,two foursided dice, so damage can be lowest 2 biggest 8, and between.

Random.Range(minValue, maxValue) is your friend here (but watch out, the version with int parameters is inclusive-exclusive, because it was designed for getting random values from indexable collections like arrays).

To make it easier, here is a generic solution:

public static int Dx (int numSides) { return Random.Range(1, numSides + 1); }

public static int nDx (int n, int x) {
    int result = 0;
    for (int i = 0; i < n; ++i) { result += Dx(x); }
    return result;

public static int nDxPlusC (int n, int x, int c) { return nDx(n, x) + C; }

In your case you would use the above the following way: int damage = nDxPlusC(2, 4, 1);