They will be okay if it is just a once off, but they absolutely should not be allowed to eat the food long term. Chicken pellets are generally high in calcium as the chickens need to to develop their egg shells, a diet high in calcium can cause guinea pigs to develop bladder stones.
Is there any way you can house the guinea pigs separately from the chickens? That is really the only way to stop them eating the chicken pellets.
Also another thing to consider, depending on where you live, is guinea pigs are not suited to living outside as temperatures over roughly 29 celsius (84 fahrenheit) will cause guinea pigs to get heat stroke which can very quickly kill them.