Pillows with all the usual stuffings (hollow fibre, feathers, down) can be washed in a washing machine, with caveats.
Use 40C only. 60C totally ruins feathers, and can damage synthetic fills too.
A wet pillow is always a heavy offcentred item, so it puts a lot of stress on the drum bearings and suspension. Most modern machines are ok with this, but machines that can't cope with it do exist. There are probably also a few old machines still in service that dance across the floor or hammer on the kitchen cabinets with such a load.
The main issue is drying time. A pillow must be completely dried through, not to damp but to totally dry, within a short time, otherwise it goes mouldy and spoils. The only way to achieve this is to fan air through it. This can be done by propping it up right in front of a deskfan for 2-3 days, or hanging it under a ceiling fan. The pillow position should be changed twice a day, as however it sits or hangs there are some parts being compressed, and getting little airflow.
Obviously the centre is still damp long after the outside is all bone dry, and no damp can be left inside, or it spoils.