Let's say I wanted to deliver a book that is banned in Bob's country. This book is not banned in my country. I understand that if I go to his country to deliver it, I may get arrested, because I'm breaking the law of possessing the book. What happens if I just send the book by mail? Bob would break the law for possession of the banned book, but would I be doing something illegal? What are the possible consequences?
As a general rule, most countries have what's called Bi-Lateral extradition treaties, which means that Country A (Cedricstan) will only extradite to Country B (Bobtopia) for crimes that were committed in Bobtopia AND are crimes in Cedricstan.
So, in this scenario, you, a Cedricstan citizen purchase the book "The Big Book of Banned Things in Bobtopia" and send it to Bobtopian Bob by international mail. Bobtopian Ministry of Banned Stuff police (BMBS) find Bob in possession of the book and through creative interrogation (cause all countries that ban books are surprisingly creative in interrogation techniques) figure out that you sent it to him. The would file an extradition petition with the Cedricstan Embassy, who then call up the Cedricstan Ministry of Justice (CMJ) and discuss the charges (if there's no extradition treaty, the process is basically the embassy staffer politely taking the note and giving it to the Ambassador, who tries not to laugh too much as he dumps it to the bin. If there isn't even diplomatic relationships, this is the same process, but now it's the Swiss Ambassador laughing instead of a Cedricstan Ambassador).
Anyway, assuming Cedricstan and Bobtopia have an extradition treaty with each other, it's going to be Bi-Lateral, meaning Cedricstan will only extradite you for crimes committed in Bobtopia that are also crimes in Cedricstan. So, first off, you did not possess the book while in Bobtopia, so the crime didn't happen in Bobtopia and they have jurisdiction over the crime. The legal ramifications are that of Cedricstan, not Bobtopia, so they apply here. Given you bought the book in Cedricstan, you're likely to not face any legal ramifications (well... more on this in a moment).
Suppose then, we some how get to the point where you are proven to have been in Bobtopia and possessing the book of very naughty knowledge, Bobtopia Ed. In this case, Cedricstan would have to consider if it is a crime here (kinda... more on this as well). Since Cedricstan has Constitutionally protected Freedom of Speech and Press, there is no equivalent crime for possessing Forbidden Knowledge II: Bobtopia Boogaloo, which not only is legal to own, but a Cedricstan Times Best Seller for the 104th week running. So in this case, Cedricstan laughs in Free Speech and refuse to extradite you. There are again, no legal ramifications (well... more on this in a moment... which would be next paragraph).
So, of course, this assumes you're not going to go to any country ever in the future. Obviously, Bobtopia agents from the BMBS will happily greet you if you ever go to Bobtopia... creatively of course... But you should probably review the diplomatic relationships of other nations with Bobtopia and their laws on banned literature... it could be that their extradition treaties will allow an agent of the third nation to arrest you and extradite you to Bobtopia... if you realize this is about to happen, your best bet is to find a Cedricstan Embassy or Consulate and high tail it there. But otherwise there shoudln't be any issues.
The other problem here is that nations may have additional rules. For example, the United States does not allow for libel tourism... which is using another nation to sue an American for defamation that doesn't rise to the Defamation under U.S. Law (which is notoriously stricter than most similar nations. Historically, close relations between United States and UK would mean that defamation of a UK person said in the United States could be tried in the UK and the U.S. speaker would be under their jurisdiction... The ban here prevents that by saying the United States would not enforce decisions unless their own courts found the case in a similar way.
On the other end, Canada will not extradite murderers to the United States, if said Murderer is eligible for the Death Penalty... but a Prosecutor promising to not seek the Death Penalty in sentencing if guilt is found is good enough for Canada to extradite the murderer back.
TL;DR: As long as you stay in your country, you should not be extradited for crimes that are not mutually recognized... be careful when you leave though.
It's certainly possible for the country to make your out-of-country actions illegal if they involve interacting with the country and its laws.
The people in that country who actually enforce the law have to deal with practicalities. Should they think about prosecuting you? Well, consider.
- Are you a faceless corporation like Amazon just doing that thing you do to every country in the world? Your legal department ought to know not to ship that book to that country, but it could've been an honest data entry error, and you are too "faceless" to identify a human to prosecute. This would be impracticable.
- Are you a small bookseller with a face, but whose core trade is shipping books all over the world... But you are too small an operation to have a legal team to know every law in every country, and were probably oblivious to their law. That means no intent, and in most places that means no crime. Trying to harass this poor bookseller would wind up on the evening news and frame the country in a very bad light.
Or is this "personal" for you?
- Do you not sell books generally but only sell this book, and you perfectly well know it's banned in that country?
- Are you the author of the book, hated by the government?
- Do you have an entanglement with that country and Bob, and this is a product of a friendship and a shared plan to challenge the government?
These last few things are the kind of thing that would get the country's law enforcement up in a lather. And your country's media would roll their eyes and go "Saw that coming".
What could they do? They wouldn't have any luck with extradition, because your precondition is that the book is legal in your country.
I suppose if they're so angry as to risk an international incident, they could attempt an extrajudicial kidnapping or an assassination. However, the loathing would have to be quite extreme, because of the high risk. Even moreso if your country is one who likes to send in an SAS team to rescue or avenge their citizens abroad.
Other than that, though; they'd probably just stick a note in your immigration file, and lay in wait until you try to visit their country. The note would say "Detain and arrest."
As far as Bob's guilt, the pivotal question is whether he ordered it. He should not be responsible for things sent to him in error or as harassment or frame-up (otherwise US senators would be constantly mailed abortion instructions).
That said, wacky countries who ban books don't necessarily follow the finest traditions of law. So you cannot count on the above actually applying.
In addition to the answers already given, there have been a significant number of times when an individual who has committed a crime in a foreign country and has evaded extradition (or where no extradition treaty exists) will simply be abducted from their current country by burly men in an unmarked van and shipped out to the country in which they committed their crimes.
There have also been cases where those suspected of committing crimes have been abducted by burly men in an unmarked van and shipped to a third-party country so that they can be tortured, usually for information but also just for the sheer hell of it.
In general, a country's laws do not have extraterritorial effect unless
A) The law targets the country's own citizens, and in some cases resident aliens (i.e. lawful permanent and non-permanent residents); or,
B) There is some situation connecting the crime to that country.
As examples from the U.S.
A) A citizen/resident alien poaching protected wildlife overseas
B) A non-citizen using U.S. currency or bank accounts in the process of committing an otherwise domestic crime (how the U.S. targeted FIFA)
It just depends on what the laws are in Bob's country. If the law in his country says it is a crime to mail a book here, you broke the law. If the law says its only a crime to possess the book, then Bob broke the law by having it.
It's just like mailing something illegal to another state. If it isn't legal to have a bomb in a state you mail it to, I doubt that state wouldn't prosecute you for tranporting (or causing to be transported) the bomb.
Even though you are not a citizen of that state, you obviously can not send something illegal there. I don't know what laws Bob's country has, but if sending a book there violates them you would have to pay whatever price if they caught you doing it.