Most freighter aircraft (excluding smaller aircraft) do have a small number of passenger seats, normally intended for use by staff such as deadheading/additional pilots, other company staff, etc.
Whilst it's possible that freight airlines somewhere in the world do accept paying passengers, in general it's not possible unless you work for the operator of the plane. Some cargo companies allow select staff to fly on their flights for any purpose, whilst others only allow those travelling for business purposes.
There's a number of reasons that it's not allowed, but in it's simplest form it's due to the licence class of the aircraft itself, which will not have been certified to carry paying passengers. In most cases this will be form of the airlines "Air operator's certificate" (AOC) not allowing for passenger traffic, either at all, or on specific types of aircraft such as freighters.
Carrying passengers would also require the flight to have flight attendants in order to meet requirements for safety, and for an aircraft that might have as few as 4 passenger seats that's simply not financially viable!
Even when only carrying their own staff things can still go wrong, such as in the case of Fedex flight 705.