It depends on the signature-scheme, in detail: on the verification. Not every single signature-scheme has a malleability for that attack.
This answere will be split in describing ElGamal, then pointing out the malicious step and conclude, why it is malicious.
ElGamal
Preset
Let us keep an eye on the ElGamal Signature Scheme [1]. We will randomly choose a secret $x\in \{2, ..., p-3\}$, where $p$ denotes a "large" prime. We then will compute the public key $y=g^x\bmod p$. $H$ describes a hashing function with integer output.
Signature
Input: (g,p,x)
Output: (r,s)
Algo:
1.) Choose a (random) coprime $k\in\{2, ..., p-2\}$ (coprime means: gcd(p,k)=1)
2.) Compute $r\equiv g^k \bmod p$
3.) Compute $s\equiv (H(m)-xr)k^{-1} \bmod (p-1)$ (Here you see, why k has to be coprime, otherwise $k$ is not invertible and you can't compute $k^{-1}$.)
4.) If $s\neq0$ publish $(r,s)$ as the signature of the message $m$.
Verification:
Check, if the signing output tupel $(r,s)$ is valid.
Input: (r,s, g, p, y) sometimes $m$ is left or added. Keep in mind, you need the message, since all "keys" are depending on that. (Sence of signature :D )
Output: bool 0 or 1.
Algo:
1.) Check if r and s are valid, so if $r\in\{1,...,p-1\}$ and $s\in\{1,...,p-2\}$.
2.) Check if $g^{H(m)} \equiv y^rr^s\bmod p$
Note: I'd chose $(r,s)$ in analogous to Wikipedia. You provided the Signature as $s(m)=:\overline{s}(m)$. The connection is made by $\overline{s}(m)=(r(m),s(m))$
Malicious
The 2nd step is the malicious one. Lets fill in, how we computed $r, s$ and $y$. You will get:
$y^rr^s = g^{xr}\cdot g^{k(H(m)-xr)k^{-1}} = g^{xr +H(m) - xr} (\bmod p)$
Note: You can see, why $k$ has to be invertible.
Since your question does not have the mathematical background, we will further discuss the key-substituion.
Key Substitution
The first question to answere is: How do we have to compute another key $\overline{k}$, so that the verification-step will output "true".
As you might expected, you could use every $\overline{y}=y^{Z}$ where $Z\equiv 1 \bmod (p-1)$, since the modular arithmetics is bilinear in addition and multplication. ($p-1=\phi(p)$ if p is a prime, as in this case.) But note, this "attack" can easily be prevented, by checking $y<p$. I do not have any more sparetime to add more attacks like this :( Anyone feel free to add and correct. :)
Sources
[1] https://en.wikipedia.org/wiki/ElGamal_signature_scheme