This is another thorn in the flesh of a lot of my students. Let’s bury it once and for all:

Can applies to what is possible and may to what is permissible.
You can drive your car the wrong way down a one-way street, but you may not.

Whenever someone says to you that

You can’t talk to me like that.

You should reply:
But I can, and quite easily.

What was meant, though, was that you may not or should not or ought not.