The allusion in Chapter 2 is to a novel called Coral Island, an adventure story for boys of boys stranded on a coral island. It is clear that in this chapter this allusion excites some of the boys who have read this tale - they think they will have similar adventures and enjoy themselves before being rescued. However, linked to the larger purpose of this Chapter, we can see that this romantic notion of their experience quickly fades away into bickering. Indeed, this chapter recounts the slide from organisation to chaos that we see continued in the rest of the novel. As the meeting begins, we begin to have some hope in the ability of the boys to organise themselves. The idea of the conch seems to be working, and they are making plans and then carrying them out. However, the introduction of the fear of the "beastie", Jack's obsession with hunting and the well-intentioned but badly-actioned plan of the signal fire allow this organisation to break down. Despite their intentions, the inability of the boys to stay focussed on their plans results in disaster and the fire perhaps killing one of their number, and they learn the hard way that their actions can result in disaster and destruction rather than salvation. Therefore the allusion to Coral Island is rather sarcastic in some senses - it is in direct contrast to the actual experiences of the boys.
When chapter 2 begins, the boys are beginning to come to terms with the fact that they are stranded on a deserted island, and rescue isn't likely to come any time soon.
"Nobody knows where we are. We may be here a long time.”
The boys are shocked into silence at this realization; however, Ralph announces that their time on the island is nothing to worry about. He says that they are on a good island, and they all can enjoy their time on the island waiting for rescue.
“While we’re waiting we can have a good time on this island.”
He gesticulated widely.
“It’s like in a book.”
At once there was a clamor.
“Swallows and Amazons–”
While several books are mentioned, The Coral Island is the allusion that the question is likely referring to. In that particular book, several boys are stranded on an island, and they are forced to fend for themselves. The island is portrayed as near idyllic with abundant food and water available to the boys. Additionally, the boys successfully work together and build shelters and canoes.
The allusion to The Coral Island is deeper than just mentioning the book and having a similar setting. Two of the main characters in The Coral Island are named Jack and Ralph. Those two boys do encounter "primitives" that want to cause them harm, and fire even plays an important role in The Coral Island as well.
Golding was supposedly partially inspired to write Lord of the Flies because of his boyhood experience with The Coral Island. However, Golding fashioned Lord of the Flies as a rebuttal to The Coral Island. In Golding's book, Jack and Ralph definitely do not work together. Most of the boys are incapable of working together for the good of the group. Additionally, Lord of the Flies does have "primitive" characters that want to do harm to other characters. However, those malicious characters are the same characters that initially thought the island would be an idyllic paradise. The boys on the island ultimately become the most dangerous predators on the island. Lastly, fire is important in Golding's book, too; however, it isn't used to rid the island of "false gods" and restore peace. Jack uses the fire as a weapon of destruction in order to hopefully corner and kill Ralph.
At the end of Lord of the Flies, Golding wants to make sure that his readers understand his allusion to The Coral Island is noticed. Ralph is being rescued, and one of the officers mentions that Ralph's experience must have been like the experience of the Ralph in The Coral Island.
“We were together then—”
The officer nodded helpfully.
“I know. Jolly good show. Like the Coral Island.”
As Golding's book comes to its final conclusion, readers are painfully aware that Ralph's island is nothing like the adventure that he and the other boys had initially hoped for.