permanent to hold presssure or temporary to keep the animals out during construction? Cap generally fits on spigot or plain end of pipe. Plug generally fits in the bell or hub end. Blind flange is also used on flanged valves or fittings. Contractor and resident engineer can easily determine which is needed in the field.
This is basically true. If you are talking about just straight segments of the most common standard bell-and-spigot push-on segmented underground piping systems, of course with normal spigot into bell insertion (and unless you do some cutting), you of course are looking at some sort of bell on one extreme end of the piping, while you are looking at some sort of spigot on the other extreme end. While a "cap" is generally considered to be something that will fit over the plain or spigot end, it will not (unless it is very special) go over the bell end without some effort or modification (like cutting the bell off in the field where the piping will allow this).
If we are talking about say standardized mechanical or push-on joined items (of which there are literally millions of both out there!) push-on restrained and mechanical joint plugs are often preferred for convenience where such hubs are available or convenient and the line can be bulkheaded (for testing and/or future connection etc.) there, as these plugs are self-restrained and do not require cutting the bell off or cutting of a separate plain end by plain end spool and purchase of a separate item (like a separate retainer gland etc.) to accomplish unblocked thrust restraint, at least of that joint.