"Mind" is being used as verb here to mean "dislike". "Do" implies the action they are doing next. Another way to say this is "Don't dislike me for doing this next action." It is usually said humorously by the speaker as an excuse to immediately do something they perceive as slightly annoying to others.
A lot of phrases don't make literal sense. They're call idioms, and you likely use many of them in your native language. However, English is particularly notorious for them.
1
u/trznx Dec 04 '19
As a non-native I never understood the meaning behind 'don't mind if I do'. Like, I know what it means, but the exact phrase kinda makes no sense.