Thais will make merit by making donations to the temple. Attending the fair and playing the midway games is often seen as a way of merit making in itself. Going to a temple fair, be sure to dress properly as entering a temple. There's often a bit more leeway in the relaxed atmosphere of a fair, but you will generally be far better received if you show respect for the customs.