Note: It should be "put" (not "but") but yes, you can say this.
Putting yourself in another person's shoes is an idiomatic way of describing seeing or experiencing something from someone else's point of view; in this instance, feeling the hurt another person feels.