Is it safe to wrap Mac cord with a cloth?
I'm assuming that you are referring to a Macbook brick. 

The thin (low voltage) side is either 14.5V (Air) or 20V (Pro). I don't know about the USB-C connector. 

Cloth MIGHT be safe on the low voltage side if just the covering separated, but if it has to be in a specific position to work, you probably have a broken wire as well which could lead to sparking under the wrong conditions. 

The only truly safe thing to do is replace your adapter. You can use proper electrical tape until then, but it should only be a temporary measure.

If it's on the other side of the brick, replace immediately.