If we set the attenuation per unit length of each of the $n$ segments as $\mu_i$, and they have a length $\ell_i$, then the transmitted intensity is
$$I_t = I_0 e^{-\mu_1 \ell_1}\cdot e^{-\mu_2 \ell_2} ... = I_0 \prod_{i=1}^{n} e^{-\mu_i \ell_i} = I_0 e^{-\sum{\mu_i \ell_i}}$$
The value of this expression is the same whether you evaluate from $i=1$ to $i=n$, or start at $i=n$ and work down to $i=1$. So the simple answer is - it doesn't matter whether the beam goes left to right, or right to left.
However - it is possible that you will observe a different intensity on your detector, depending on the materials used and the experimental setup.
The reason for this is scatter: for a given energy of X-ray, atoms of a particular Z have a certain probability of (Compton) scattering the incident radiation, rather than absorbing with photo-electric absorption. In Compton scatter, the photon continues with reduced energy and a new direction; with photo-electric absorption, the full energy of the photon is absorbed so it disappears. There is also a small probability of coherent scatter (without loss of energy) and, at very high energies, of pair production; but for medical X-rays (20 - 120 keV) and for most common materials, the dominant mechanisms are Compton and photo-electric interactions.
Now if your detector is not well shielded / collimated, it can detect radiation from any direction; if your first block in the attenuator is a low Z material (lots of scatter), then a certain amount of scatter will reach the walls of the room and scatter back to the detector; if turning the block around, you start with a high Z material (little scatter), then few of the X-rays that reach the low Z material will have this alternative path available.
This effect will only matter if you have a poorly shielded detector and "other stuff" (besides the attenuator you drew) in your setup. But in reality, you usually have a bench, walls, etc. So it is something worth keeping in mind.