Can cam impingement only arise from anatomy or can it be caused by shoes or activities that require a lot of external rotation of hip?

Injury. Hip impingement can be from anatomy but is often from an injury or repetitive stress from an activity. Physical therapy is often helpful in the early stages.
Let me explain. A deformity of the ball at the top of the femur (called cam impingement). If the head is not shaped normally, the abnormal part of the head can jam in the socket when the hip is bent. This may occur during activities such as riding a bicycle or tying your shoes.