EGS4 Monte Carlo simulations have been performed to examine general cavity theory for a number of TLD cavity materials irradiated in megavoltage photon and electron beams. The TLD materials were LiF, Li2B4O7, CaF2 and CaSO4 irradiated in Perspex, water, Al, Cu and Pb phantoms. For megavoltage photon beams, this has been done by determining the dose component (1-d) resulting from photon interactions in the cavity compared with the dose component resulting from photon interactions in the phantom material (d) by Monte Carlo simulations and analytical techniques. The results indicate that the Burlin exponential attenuation technique can overestimate the dose contribution from photon interactions in a 1 mm thick LiF cavity by up to 100% compared with the Monte Carlo results for LiF TLDs irradiated in a water or Perspex phantom. However, there is agreement to within 1% in the quality dependence factor, determined from Burlin's cavity theory, Monte Carlo simulations and experimental measurements for LiF and Li2B4O7 TLDs irradiated in a Perspex or a water phantom. The agreement was within 3% for CaF2 TLDs. However there was disagreement between Monte Carlo simulations and Burlin's theory of 6 and 12% for LiF TLDs irradiated in copper and lead phantoms respectively. The adaptation of Burlin's photon cavity theory and other modifications to his photon general cavity theory for electrons have been shown to be seriously flawed.