How should I replace door chime transformer at breaker panel?
You should follow the instructions provided with the transformer here. Most I've seen have the threaded portion that goes through the knockout made of plastic, and therefore require the ground wire to be used for bonding. There may be some transformers that can be grounded via the knockout to the metal box directly. The instructions should tell you for sure.
You can make splices inside your breaker panel the same way you would in any other junction box. If you have wire nuts or lever terminals and some wire on hand, use that to extend the ground so you can reach the ground terminal. For the ground, you should only use green or bare copper wire.
And it seems you probably already know this, and you didn't ask, but for the sake of completeness, you will want to make sure the white wire on the new transformer is connected to the neutral bar, and the black to the hot of wherever your previous transformer was connected.