My question is basically this. Is the second law of thermodynamics a fundamental, basic law of physics, or does it emerge from more fundamental laws?
It would be useful first to say what is the 2nd law and what it isn't.
2nd law: when system goes from equilibrium state 1 to equilibrium state 2 in any way and exchanges heat with reservoir at temperature $T_r$,
$$
S_2 \geq S_1 + \int_1^2\frac{d Q}{T_r}
$$
In special case there is no heat transferred,
$$
S_2 \geq S_1.
$$
This law is valid for controlled macroscopic systems such as the working medium in a heat engine. Within this domain, it is a basic law.
2nd law does not say that the entropy of all systems or Universe has to increase in time. It speaks only of states of thermodynamic equilibrium.
There were and are attempts to derive 2nd law from microscopic theory, but there are always some additional assumptions about the probability. With these, it was proven that the above law will be obeyed in an actual process with probability very close to 1 (the greater the number of particles, the better). Since probabilistic ideas are involved, it cannot be said that the law is derived as unescapable consequence from the equations of motion.
Let's say I was to write a massive computer simulation of our universe. I model every single sub-atomic particle with all their known behaviours, the fundamental forces of nature as well as (for the sake of this argument) Newtonian mechanics. Now I press the "run" button on my program - will the second law of thermodynamics become "apparent" in this simulation, or would I need to code in special rules for it to work?
Most probably it will not be apparent, since it would hardly be possible to ascertain whether the system is in some kind of equilibrium state.
If you somehow extend the notion of entropy to complicated particle/field system in any microscopic state, then the question makes much more sense, but then it is also no longer about the entropy of the 2nd law, only about the new concept of entropy.
Then, you will need to start the simulation with some initial conditions (boundary conditions). If all the basic equations in the computer model are time-reversible (and the most basic equations of motion are), then for each initial condition that leads to increasing entropy there is an initial condition that leads to decreasing entropy.
To find such "weird" condition, let's think of a model that describes particles moving under influence of their gravitational forces. Just consider the trajectory that increases entropy, take its final point, reverse all the velocities and start the simulation again. The system will retrace its past states, so its entropy has to decrease.
One can get systematic increase of entropy only if the initial states are being chosen in a special way. We do not know whether the Universe started in such special state or not, or whether the entropy of the Universe, be it anything, increases or not. These and related questions of "heat death of the Universe" are entirely out of scope of the 2nd law of thermodynamics.