I'm surprised no one has mentioned (afaics) the 4d6 force damage called out in dimension door that could arguably apply for attempting to teleport into a place already occupied by a creature, if that "place" were interpreted to be the space controlled by the dragon. Personally, though, like the OP, I would allow the spell to work, treating the dragon's back as the "floor" of the desired spot to which the wizard and cleric would teleport on the wizard's turn and putting them in adjacent spaces just above the dragon's. At this point, therefore, they would be in "free fall" above the dragon rather than supported by it.
What would happen next, in my game, would depend on initiative order. The wizard has already used their action to cast the spell, so assuming no movement on the wizard's part, their turn would end with the wizard and cleric in their spaces above the dragon's space. If the dragon's turn intervenes between the teleportation and the cleric's turn, then the dragon would continue its flying movement out from under the two PCs, and they would both fall. This could be avoided, however, if necessary, by the wizard holding the spell's effect until some perceivable circumstance after the dragon's turn and before the cleric's turn, if one can be arrived at, like the attack of some ally whose turn happens between the two. In either case, though, when the dragon moves, the wizard falls, so hopefully they have feather fall prepared.
The cleric's turn, assuming it happens before the dragon's, begins with the cleric in free fall just above the dragon. They would need to enter the dragon's space in order to treat its back as terrain and not to begin falling immediately by taking the Climb onto a Bigger Creature action from DMG, p 271. You can only enter a hostile creature's space if it's two sizes larger or smaller, so a green dragon would need to be an adult or older, or the presumably medium-sized cleric couldn't land on it and would begin falling immediately. If the cleric was small, it could be a young green dragon. For the purpose of this example, I'm treating the use of this action as an exception to the general (albeit unstated afaics) rule that falling is resolved instantaneously. I would not, for example, simply allow the cleric to use their action to reach out and touch the dragon before falling. This is based on an assumption that the general rules assume characters have a place to stand or some other means of support rather than being in free fall. In this way, use of the action is operating somewhat like a saving throw except it would use the cleric's action to change the default situation which is that the cleric is in free fall and falling instantly.
According to the optional rule, I would ask the cleric's player for a Strength (Athletics) or Dexterity (Acrobatics) check contested by the dragon's Dexterity (Acrobatics) check to successfully land on the dragon's back. On a failure, they would fall instantly. If successful, the dragon would have a chance on its turn, again according to the optional rule, to dislodge the cleric as an action by making a Strength (Athletics) check contested by the cleric's choice of a Strength (Athletics) or Dexterity (Acrobatics) check. If the cleric is again successful and still maintaining concentration on dispel evil and good, only then could the cleric, on their next turn, use their action to touch the dragon and break the enchantment.
In the second situation, where the cleric has a solid surface on which to stand and has managed to come within five feet of the dragon, I would not require an attack roll but would allow the cleric to use their action to touch the dragon as the spell describes.