Recently a lot of people have been asking whether it's legal to use a particular method of predicting diamond ore locations, most commonly using swamp biomes and clay.
This exploit is not allowed.
Generally, exploiting issues in the game's RNG for profit is not allowed.
The one thing related to diamond ore finding that is allowed, is the fact that the game only spawns 1 vein per chunk. It is not against the rules to stop mining in a chunk after you've already found diamonds in that chunk.