I can only report on my own limited observations, but I've done some extensive modding of geologic layers/veins/clusters in an unreleased mineral overhaul mod. What I've observed is thus:
Frequency values for minerals are only used when the material is allowable within a selection pool, and only for non-layer materials. For example, the game determines that a layer material will be SEDIMENTARY class because of both the world seed as well as the world-gen geology rules; the game then runs a selection pool of all sedimentary class layer minerals. Because this is a layer decision, all SEDIMENTARY minerals are equally weighted to appear when the game places this layer.
The game repeats this selection processed for each layer section of the world, and then moves on to placing minerals within the layers. This is when frequency and ENVIRONMENT comes into play. During world gen the game will make many calls for placement of various minerals/materials, picking based on relative frequency of each candidate for that group in the selection pool for that call. The game makes calls for placement of layers, then veins and clusters, and then other special features (small clusters, trees and plants).
There seems to be a hierarchy to the order that minerals are placed in the world:
LAYER --> CLUSTER --> VEIN --> CLUSTER_SMALL --> CLUSTER_ONE
This is observable in that large clusters do not overwrite veins (or at least, I've never seen it) but veins will run through large clusters and into/from the surrounding layers. Similarly, small clusters can overwrite locations in veins, and single cluster minerals can overwrite small clusters. I could be wrong in this assumption, as I haven't run extensive tests to back this up yet.
The LAYER mineral is always placed down first. From there the game will calculate, based on the seed algorithm and the MINERAL_SCARCITY setting of world-gen, if it wants to place clusters or veins within a section of the ENVIRONMENT layer. The frequency settings on the minerals, to the best of my knowledge, have absolutely zero impact on the game deciding how many additional clusters and veins to place within environment layers (or within the clusters/veins themselves); it is the mineral scarcity setting prior to world gen that determines how many minerals you get. If the placement algorithm says YES to placing a cluster or vein, then all possible candidate minerals that are viable for that ENVIRONMENT class (have the right tag) are placed in a pool and weighted based on their frequency values in regards to the ENVIRONMENT being called in the placement decision. A winner is picked and placed within the layer. The process repeats based on MINERAL_SCARCITY restrictions.
The placement algorithm will also run checks on all placed minerals as part of this process, determining if they are themselves a valid ENVIRONMENT for additional minerals, in addition to host layer. This is where ENVIRONMENT_SPEC tag comes into play. If the placement algorithm says YES to placing another mineral within a previous one, it will place all candidates with valid _SPEC tags for the host mineral into a frequency weighted pool and pick one to place. This is not guaranteed to happen; it still depends heavily on your MINERAL_SCARCITY world settings.
Take the example of all the rare diamonds in the base game. Each of them only occurs as a CLUSTER_ONE in the ENVIRONMENT_SPEC of faint yellow diamond. Not every faint yellow diamond cluster will have a rare diamond occurring in it, but every time the placement algorithm determines a faint yellow diamond cluster will host another mineral, it will be one of the rarer diamonds, as they are the only viable candidates for faint yellow diamond as the host.
Minerals can definitely be placed within one-another, but it usually requires a very high mineral occurrence (low MINERAL_SCARCITY) settings to be easily observed.