In a compact orientable space the total magnetic charge (or electric change for that matter) must be zero by Gauss's law. All the magnetic field lines leaving the monopoles must go somewhere, so they collect on equal amount of anti-monopoles. The proof of the statement is simple--- you take a small sphere with no magnetic charge inside, and consider it the boundary of what you would locally call the outside region. The total charge on the outside must be zero too. When the net magnetic charge is zero, the Dirac string can be chosen consistently to end on magnetic charge.
When the space is not orientable, the argument applies to its double-cover, so that the Dirac string can go between monopoles and their complementary image. A non-orientable space itself must be covered by several overlapping charts, and in the case of a nonorientable space, you can make the Dirac string be on one chart and not be on another.
To see that the cases I am talking about are not vacuous, consider a Klein bottle cross a circle, (a periodic box in x,y,z of unit size, with the x-coordinate identified in the opposite sense across the period). The double cover is the torus. Then place a single magnetic charge at the center of the Klein bottle. The magnetic field changes sign under a reflection of a coordinate perpendicular to the field, and maintains its sign under a reflection of the coordinate parallel to the field direction (this strange behavior becomes obvious if you consider the magnetic field as a 2-index antisymmetric tensor). So the magnetic field of a monopole in the Klein bottle cross a circle is consistent--- it is the same as the magentic field of a monopole and anti-monopole in the torus double-cover.
In this situation, the Dirac string will go from the monopole to the anti-monopole in the torus, but in the Klein bottle description, it must be described coordinate patch by coordinate patch.