Replace 3-way switch with one single pole dimmer
This is a pretty common problem. A three way switch has 3 posts for connection 2 posts are for the carriers between the switches and one post that is for the line/load. So line side (hot wire) attached to one side of the 3 way and the load side (switch leg) attaches to the other and up to the lights being served. Your problem is the one of the line/load conductors is attached to one of the carrier posts and off course the carrier is reversed also. So it's just a matter of having the right wires on the right posts.

If you want to abandon switch 2 you can simply remove the wires from it and connect the line/load conductor to a carrier then find that conductor in the switch 1 box and use it as the new line/load conductor then connecting it to your dimmer. Be sure and wire nut off and make safe the extra carrier conductors.

The problem is that the next person living in the house may want the 3-way back. So might I suggest you repair the original problem. Then purchase a three way dimmer and leave them both in place.