You can try placing them on your stomach and giving them food, one guinea pig at a time, of course. While they eat, you can gently pet them on their back. This way, they get used to being petted and associate it with something positive, like eating their favorite food. Please consider to no pet them on their lower back and to not touch their ears. Also, they are not dogs neither cats, they are way more delicate, so you need to pet them very, very gently, as I said before.