Strictly speaking, only the first two are grammatically correct in the Past Perfect.
First I'll offer a quick refresher on Perfect tenses.
We usually uses a Perfect tense for one of three approaches:
1) Describing Life Experience (I've never been to the Moon.)
2) Describing a Change in Situation (I've just visited the Moon!)
3) Describing activity Up To Now (I've visited the Moon twice so far.)
These are also true in the Past Perfect:
1) I enjoyed my visit, because I'd never been to the Moon before.
2) I was tired when you called me, because I'd just come back from the Moon.
3) I was prepared for my trip for Mars because I'd been to the Moon twice.
In all these cases, it's the same usage, but we're focusing on a time in the past. In the past, I enjoyed my visit -- I enjoyed it because before that visit I had never been to the Moon before. I was tired in the past, because before that time I had just returned from the Moon. And, in the past I was prepared for Mars because even earlier in the past I had visited the Moon twice.
Now, looking at your examples:
1) Two days after I went to school, I got sick (Two days after I had gone to school, I got sick)
Using Past Simple, we're just saying X happened, then Y happened. However, using the Past Perfect, we're saying that I got sick in the past, and that happened two days after I had gone to school before the time when I was sick.
So, #1 is correct using either tense. They describe the same data but if we use the Past Perfect we're using the Change in Situation meaning to talk about the time when I was sick and show a past change which occurred before that time. It's a bit like "I felt funny after I'd landed on the Moon.", or "I felt sick two days after I'd landed on the Moon.".
2) I went to school two days ago, and I got sick (I had gone to school two days ago, and I got sick)
This one is possible but a bit unnatural. Firstly, "ago" is normally used to mean "before now", but you could use it in this case if you mean two days before now. You would probably instead say "I had gone to school two days earlier, and I got sick.".
Now for the tenses: The Past Simple simply tells that X happened, then Y happened. However, the example with the Past Perfect sounds like we're emphasizing that when I got sick, I was at school -- something was different. This is again Change In Situation (I had transitioned to school from elsewhere, and this is relevant to the rest of what happened).
Consider this context, as an example: My mother warned me to eat well during my first week in college, but I didn't listen. I had gone to school two days before, and I got sick. I had to go home and recover.
3) Two days later, I went to school, and then I got sick (Two days later, I had gone to school, and then I got sick)
This doesn't really work because the word "then" signifies a sequence of X happened, then Y happened, suggesting that we're thinking of both in the same tense.
You could instead say the following: By that time, it had been a long summer. I had returned home from Germany in June. Two days later, I had gone to school, and then I had gotten sick.
Optionally, you could say: That year, it was a long summer. I had returned home from Germany in June. Two days later, I went to school, and then I got sick.
When we use the Present Perfect, we're actually talking about the present as a result of the past. (I have sneezed, and I need a tissue.) Past Perfect is similar -- we're talking about a time in the past as a result of an earlier event in the past. (I had sneezed, and I needed a tissue.)