Your friend is at least partially misinforming you. It's fine to write k instead of ok in almost all situations. But either of them can be rude if the other person would expect more emotive words. For example here's when k is fine:
Them: Bring my pen when you come into the other room
You: k
And here's where k is not fine:
Them: Wanna go grab some drinks tonight at 8?
You: k
That's rude. They would want to hear you actually be interested in their invitation. Like saying "great" or "I'm in" or whatever.