Reading about index calculus for discrete logarithm, I noticed that it works for $(\mathbb Z / p \mathbb Z)^*$. Is this the only situation in which it works? If not, please give examples of other situations in which index calculus works to solve discrete log.
There are a various situations where index calculus can be used to solve discrete logarithms. The classic index calculus of Western and Miller can be used for multiplicative subgroups of $(\mathbb Z/n\mathbb Z)^\times$, but is most often used in the prime case. In this case the factor base is small prime numbers when the problem is lifted to the integers/rationals. (The number field sieve generalises this to prime ideals of small norm when the problem is lifted to a number field).
It was noted that the same approach can work for multiplicative (sub)groups of finite fields of small characteristic, with the factor base being polynomials of small degree when the problem is lifted to the full polynomial ring of that characteristic. (Again the function field sieve of Adleman generalises this and recent work by Joux, Granger et al improves this dramatically).
Multiplicative groups in more general finite fields can be tackled by one or other generalised approach with the (extended) tower number field sieve of Barbulescu et al finding particularly good interpolations. The Menezes, Okamoto and Vanstone attack on elliptic curves with small embedding degree works by transferring the problem to such a setting.
Adleman, DeMarrais and Huang found a way to use index calculus methods to solve discrete logarithm in Jacobians of hyper elliptic curve of large genus over finite fields. The Weil descent attack of Gaudry, Hess and Smart showed that the discrete logarithm of some elliptic curves over fields of small characteristic and composite degree can be often be efficiently transferred to this setting.
The work of Gaudry and Diem proposes a different index calculus attack on fields of small characteristic.
I don't expect this list to be exhaustive. One might also consider the multi-target Pollard lambda/kangaroo attack to be an instance of index calculus with a completely arbitrary factor base for a generic cyclic group.