For European markets...
In Europe, the most common legal problem for an affiliate is having their site blocked by ISPs. And this doesn't happen that often.
To avoid other problems (fines or jail):
Host your site in a different country than the one you are targeting. (And of course, in a country where hosting gambling websites is tolerated)
Choose a registrar for your domain name that is different from the country you are targeting. For example, do not register your domain name in France (with a French registrar) if you are targeting the French market.
Have your company (if you have one) located in a different country than the one you are targeting.
Do not reside in the country you are targeting and avoid traveling there.
Use a VPN for your work activities.
Avoid posting any information that could identify you on your website but also, in general, on the internet (facebook, twitter, blogs, forums, etc)
The law is one thing, law enforcement is another.
Don't be overly impressed by warning emails from zealous officials threatening you with hellfire if you continue to promote gambling in your target country: 4 times out of 5, it's a bluff.
Good luck!
" Money won is twice as sweet as money earned"
Eddie Felson in the movie The Color of Money