What is the origin of 洋罪? 洋 often takes on the meaning of foreign as a noun prefix - think: 洋火、洋车、洋芋、洋碱.
I have just come across this:

《成都方言》
词语: 遭洋罪
发音: zao1 yang2 zui4
定义: 自找的难言之苦：出了钱不说，还～，简直划不着！

洋罪 strikes me as a very interesting combo.
Baidu Baike just gives it one simple definition:

yáng zuì ㄧㄤˊ ㄗㄨㄟˋ
洋罪
特别的痛苦。 欧阳山 《苦斗》五八：“死了倒也自在，免得受这洋罪。这样的鬼病，能治好的，万中都无一呢。”

Very similar to the meaning in《成都方言》as, roughly, extreme pain.
The definition on Baidu Baike also matches those of 汉语大词典 and 现代汉语词典 very closely - with the same quote, even.
HDC

特别的痛苦。
欧阳山 《苦斗》五八 死了倒也自在, 免得受这洋罪。这样的鬼病, 能治好的, 万中都无一呢。


XHD

特别的痛苦。
欧阳山《苦斗》 死了倒也自在, 免得受这洋罪。

MoE says:

特別的痛苦、難過。

Which, too is about the same.
Grand Ricci says:

Peine intense; souffrance insupportable.

Which roughly translates as intense pain and unbearable suffering.
Here comes the more interesting definitions:
CC-CEDICT

1 terrible pain
2 torture
3 (coll.) pain suffered at the hand of foreigners

The third definition here actually includes the whole foreign(ers) aspect.
KEY says:

mess up by seeking to imitate foreign ways (takes verb &quot;shòu&quot;)

I really hope that KEY's definition is correct - as it is the most interesting of them all.
Is there an accurate origin of this word?
What was 洋罪 meant to mean originally?
This is really an interesting question, even as a native speaker I don't know the meaning it implies, so I did some bits of research and this answer came into my sight, which perfectly convinced me:

Original reference: [http://zhidao.baidu.com/question/18385575.html]


  所谓洋货,意思是从海洋上"漂"过来的货物,现在的话就是进口的,以前一般都是从海洋上来,所以叫洋货. 
  
  洋罪主要是日本奴役统治中国部分地区的时候,对老百姓机器恶毒,劳动强度高,生活水平却极其低,就是遭罪,而且一般的罪没法比,那罪来源于洋人_日本人,所以叫洋罪. 


The first one is talking about 洋货, of which I think you have perfectly grasped the meaning, i.e. things imported from outside China, since most goods need to be transported by the sea(洋), later people call it 洋货.

Now I will try to translate the second sentence:

洋罪 talks about the times when Japan ruled some parts of China, by those time the Japanese extremely maltreated the common people, there was a high labour intensity, meanwhile the people suffered a very poor and miserable life, but not any other misfortune can be made to compare with it because it came from 洋人(the foreigners), by so, it's called 洋罪.

Up to now, people still use this word, but the meaning of suffering from foreigners has faded out a lot, only to emphasise an unexpected feeling of sufferings.

So, in most cases if you suffer, you only say 遭罪, only in some unexpected cases, which you totally can't foresee it but you still suffer, you say 遭洋罪.

Examples:


今早上班地铁特别挤，我一直站了1个小时，真是遭罪啊。

This morning the subway is extremely crowded and I had to stand all along for an hour, I really suffered a lot!
今早上班地铁特别挤，我一直站了1个小时，中途地铁又坏了，我又换乘公交车，真是遭洋罪啊。

This morning the subway is extremely crowded and I had to stand all along for an hour, what's more, the subway broke down in the middle way so I had to take a bus instead, I could not suffer more!