The legality of euthanizing a guinea pig depends largely on where you live. In many countries, it is legal to humanely put down a guinea pig, especially when done for valid medical or welfare reasons. However, some jurisdictions prohibit euthanasia without a justifiable cause, and others have laws against killing animals in a cruel or inhumane manner.
Because animal welfare regulations can change over time, pet owners should verify the current laws in their country or region before making any decisions. When possible, consult a licensed veterinarian to ensure the process is handled responsibly and humanely.