Hi agganitk,
Both of the sentences you wrote are grammatically correct, but don't necessarily mean the same thing. "only" typically modifies what comes after it in the sentence.
1a) "I eat fish only on Saturday". "only" modifies (or limits) when I eat fish. This sentence means that I don't eat fish any other day.
1b) "I eat only fish on Saturday". "only" modifies what I eat. This sentence means that I don't eat anything else on Saturday; only fish.
2a) "The can should only be inspected prior to purchase". "only" modifies what should be done. The sentence means that the car should not be fixed, driven, transported... but only be inspected.
2b) "The car should be inspected only prior to purchase". "only" modifies when the car should be inspected. It should not be inspected during or after purchase, but only prior to purchase.
We can apply this to your examples:
3a) "I have only one of eight red boxes available." Only modifies what I have. I have just one box, not 2 or 3.
3b) "I have one of only eight red boxes available." Only modifies the number of available red boxes. There are only 8 red boxes available, not 9 or 10.
Hope this helps,
-Patrick