International trade, which isn't just the trade of goods across borders but also the trade of services, is generally seen as a good thing and encouraged. This is because a large proportion of a country's GDP (in most cases) is dependant on the export of goods and services. This means that you are effectively improving the economy of your country by offering services internationally. There are limitations in regards to which country can trade with which other country (an embargo is the prohibition of trade with another country). For example, here's a list of all the countries with which the USA has an embargo.
You would need to check that it's okay for you to trade with the country your client is in. (As an aside, this is why sometimes some countries can't sell goods to other countries online)
In most cases the relationship is a client-contractor one (as opposed to an employer-employee relationship). This means that, in essence, the client treats you as an expense instead of an employee. By doing this, the client is buying your writing services as a product (per page or time unit), in a similar way to how someone would buy a gift from an American online store even if they're in South Africa. So, you could offer your services to clients online and never visit them in real life or go to their offices.
A visa is a document that allows you to enter a country physically. So if you offered writing services to someone online, you wouldn't need one, since you wouldn't have to visit them.
If you wanted to go to visit the client in their country on a short term business trip, you could do that. Countries usually offer visas for short term business trips (a month or three at most), and you would usually be required to tell the embassy who the client is. UK Business Visa, for example.
For a longer period of time it gets sticky, because once you're in your client's country for more than 6 months you may need to pay tax, and the government will want to make sure you're not an employee, and you're not going to hang around and get too comfortable without their permission.
The above is a general guide, because I don't know the specific details of your situation. If you're unsure or live in a country where there could be an embargo, I'd recommend you check with someone who is local to your home to clarify the details.