This really depends on how you interpret "harm".
I found a site that interprets the poem a small section at a time. For that line it says:
We should build ourselves strong enough, mentally and physically, so that neither enemies nor loving friends can hurt us. Moreover, we should develop healthy relationship with everyone around us, and should not allow anyone to harm us.
So, on the physical spectrum that would mean making yourself capable of defending your person from physical harm. So, that seems simple enough.
Now, where I think it gets more complicated is with the mental/emotional side. There's plenty of room between making oneself an island, barricading others out and being "adult" enough to take criticism without taking it personally. In my interpretation, the latter is what Kipling is talking about.
I know that I struggle with openly listening to others talk about my faults and what I should improve on. It's so much easier to argue or shut them down or push them out of my life. Being an adult, according to Kipling, involves being able to listen to those statements without being hurt by them and having it impact your relationship with the other person. Letting others be honest with you and accepting it.
There's no indication that one has to accept what is said or change oneself - only that you're open to it.