If you used mmol/L your answer would be off by 3 pH units. If you look in a math book under log rules, you will find a relationships like these:

log [A*B] = log A + log B

log [A/B] = log A - log B

log [A^B] = B log A

I have usually seen the pH equation written as pH = -log [H+] which is just rearranged from the equation you wrote using the second rule above (by the way, log 1 = 0)

The two cases you described are related by a factor of 1000, right? (1000 mmol/mol) So using the first relationship above you could write the following equations:

-log A = -log A

A = B/1000

Where A is [H+] in mol/L and B is [H+] in mmol/L

Substitute B/1000 for A and divide through by -1:

-log A = -log (B/1000)

log A = log (B/1000)

Then apply the second log rule, listed above:

log A = log B - log 1000

evaluate the log and you get the answer:

log A [mol/L] = log B [mmol/L] - 3

Using the definition of pH = -log [H+] we can rewrite again to get:

pH = -log A [mol/L] = -log B [mmol/L] + 3

You can calculate pH from mmol, so long as you use mmol/mL, however. It saves a lot of math too....