Mirror coat and counter don't take into account weaknesses and resistances. They do take into account immunities however, counter won't work against ghosts or mirror coat on dark types. It's just twice the number of Hit points you take. and for the record, counter DOES work against dark types, and mirror coat DOES work against ghosts,.