Does classical simple harmonic motion violate thermodynamics? If SHM allows for motion to occur forever, we can consider it perpetual motion, does this imply that the second law of thermodynamics is violated? Or does the presence of an external force act on the system? However, there should be still a loss of energy, causing, for example, a pendulum to stop moving eventually.
 A: 
However, there should be still a loss of energy, causing, for example, a pendulum to stop moving eventually.

The pendulum will stop moving eventually, if there is loss of energy (like friction). Hence real simple harmonic oscillators always damp out.
Idealized SHOs will continue in motion forever, but there is no prohibition against objects moving forever. For example, two objects can remain orbiting each other forever (neglective gravitational waves). The second law prohibits a perpetual motion of a different kind:

A perpetual motion machine of the second kind is a machine that spontaneously converts thermal energy into mechanical work. When the thermal energy is equivalent to the work done, this does not violate the law of conservation of energy. However, it does violate the more subtle second law of thermodynamics (see also entropy). The signature of a perpetual motion machine of the second kind is that there is only one heat reservoir involved, which is being spontaneously cooled without involving a transfer of heat to a cooler reservoir. This conversion of heat into useful work, without any side effect, is impossible, according to the second law of thermodynamics.

A: No, a simple harmonic oscillator does not violate any of the laws of thermodynamics. However, it does represent an idealized system with no dissipation that cannot be exactly realized in Nature.
First law. The total internal energy of an isolated system is conserved (assuming there is no work done on the system and no heat transfer).
This law is not violated since energy is conserved in simple harmonic motion (and we are assuming there is no work done or flow of heat).
Second law. The entropy of an isolated system never decreases.
The entropy of an oscillator undergoing simple harmonic motion does not decrease. The oscillator is in a single microstate, specified by the initial position and momentum. Therefore the entropy is always $0$ (the log of the number of microstates, since $\log 1 = 0$).
Third law. The entropy of a system approaches a constant value as the temperature approaches zero.
The harmonic oscillator's ground state is unique, therefore the entropy at zero temperature is $0$.
A: Every harmonic oscillator is doomed to halt eventually. The force driving the oscillation, be it gravity, electromagnetism, or whatever force, involves radiation. Gravitational waves (gravitons) or EM radiation (photons) will take energy away. Two black holes orbiting will send out a considerable part of their energy into the universe which we can even detect here on Earth. Only in a stable, non radiating state, like of an electron around a proton, no radiation follows. But this ain't an oscillator, of course. The only true oscillator is the virtual field of particles. But then again, that's virtual...
A: Thermodynamics applies to macroscopic systems, i.e., systems large enough to allow negligible fluctuations around the average values.
Moreover, although some concepts of thermodynamics can be applied to systems made by a small number of degrees of freedom, the fundamental concept of thermodynamic equilibrium requires some efficient mechanism to have a mixing dynamics. Integrable systems like one or more harmonic oscillators are not suitable for a thermodynamic description.
