I wanted to ask can I use word "dig" with a teacher, saying, for example, "I really dig the Shakespeare's poetry"... Or it's too much informal and inappropriate?
It's informal and dated. Slang from another era. I would say "really like."
If it's dated then I why I hear it so often on TV? In context that I meant above.
Or people are using it ironically.
And it's datedness varies from period to period. In the '50s cool cats used to say 'Dig that crazy rhythm' [Hmm <thinks>, that's a quote from a spoof by the Goons...] Then it went out of fashion. Then it came back, so that in the late '60s it wasn't dated to say 'Can you dig it?' But ironical uses have made it unclear whether it's in or out of fashion at any more recent date. For example, when The Beatles used it on the Let It Be album in the early '70s it's not clear what it was. In fact, it may have been understood differently by different members of the band.
b
In AmE, "dig" is making something of a comeback, slang-wise. Ten years ago you would have sounded hopelessly stuck in the 1960s if you "dug" something, but now today's trendy hipsters and rappers are reviving the word.
Here is an example: YouTube - ‪American Idol Audition - Leroy Wells‬‏