You seem to have asked multiple questions, and the answers to them are not all the same. So let's start with the physically observable ones, that we could in principle test to see what happens, before getting into any philosphical arguments about the "centrifugal force" and whether it really exists or not.
Will an object which you place inside the 'pipe' of the [vacuum-filled] torus […] be attracted to the edge of the torus?
No, it would not. With no contact between the object and the torus, they do not interact in any way,* and in particular, the torus cannot exert any force on the object. Thus, the object will behave in the same way (i.e. floating in place) regardless of whether the torus is actually there or not (and also whether, if present, it is spinning or not).
*) I'm neglecting any gravitational and long-range electromagnetic interactions between the object and the torus here, as well as even more subtle effects like relativistic frame dragging. In principle, those could all transmit forces between the torus and the object, but in practice, assuming that neither the object nor the torus carry any significant electric charges or magnetization, those effects should be negligible.
Or would it only experience the force if it was originally touching one of the walls?
If the object was touching the walls of the torus, then contact interactions (i.e. friction, or, if you want to get ultra-reductionist, short range electromagnetic interactions) can transmit a force from the torus to the object, giving it a net relative velocity tangential to the wall.
As the outer wall of the torus is curved, whereas the inertial trajectory of the object is not, this will push the object against the wall — which, being solid, will push back, and will also exert further frictional force on the object as long as its velocity differs from that of the rotating wall.
Eventually the two will reach an equilibrium where the tangential velocity of the object equals the rotational velocity of the wall, so that there is no lateral movement between them, and so no friction forces. The only force exerted by the wall on the object at that point is the normal force that keeps the object from passing through the wall, and instead pushes the object towards the axis of the torus's rotation with just enough force to keep its trajectory circular. From the viewpoint of someone rotating along with the torus, the object has simply come to rest against the outer wall.
(While writing this, it occurred to me that it should be totally possible to do this in Kerbal Space Program, and indeed, it turns out that someone already (kind of) has. Alas, the video doesn't really demonstrate it as clearly as it could, but if you look around 1:30, you can see the rover floating inside the spinning ring until the player fires some thrusters to bring it into better contact with the ring. Also, around 5:25 the rover briefly takes off by driving against the rotation of the ring (and hitting a slight bump).)
And would the results be different if the torus was filled with a gas (air)?
Yes, because, even if the air wasn't initially rotating, aerodynamic drag forces along the walls of the torus would eventually cause the air to start rotating together with the torus. Those same drag forces would also then cause the object to move along with the air, which would eventually bring it in contact with the outer wall of the torus.
(For more details, you may also want to take a look at this thread on Science Fiction Stack Exchange, which concerns the physics of a helicopter flying inside a rotating air-filled space station.)
And if the inside of the torus was divided into sections (like the ship)?
If interior of the torus was in vacuum, but had radial walls dividing it into sections, then there would initially be no force exerted on the floating object. However, since the object is stationary but the section walls are rotating with the torus, one of them would eventually hit the object, imparting some non-zero tangential velocity to it. Again, this velocity would eventually bring it into contact with the outer wall.
OK, with the practical questions out of the way, let's get to the philosophical part:
Will an object which you place inside the 'pipe' of the torus experience the centrifugal force due to rotation?
Well, first of all, let's keep in mind that the centrifugal force is a "fictitious force" that only appears in rotating coordinate systems.
What does that mean? It means that, if we're looking at (for example) a rotating torus from the outside, but not rotating ourselves, then there is no such thing as a centrifugal force: there's only inertia (i.e. the tendency of all moving objects to keep on moving in the same direction) and centripetal forces that hold the rotating torus together, instead of having pieces of it all fly off in the direction they're currently moving.
For a simpler example, consider two spheres floating in space near each other. If you do nothing, they'll just keep floating there. If you push each of them in different directions, then they'll each float in the direction you pushed them, away from each other. But if the spheres have been tied together with a string, then the tension of the string will exert a force that will curve their trajectories into circles:
Now, if we switch to a non-inertial frame of reference which is rotating along with the spheres (say, if we consider an observer sitting on one of the spheres and looking at the other) then they will look as it they were motionless. But clearly something is still pulling the string taut (and, if it's elastic, stretching it), counteracting the tension force that is pulling the spheres together. We call this apparent force (which is really just inertia, hidden by the fact that our coordinate system is rotating) the "centrifugal force":
But the centrifugal force is not the only fictitious force that we need to add in order to explain the movements of objects in a rotating coordinate system like this. For example, consider a third sphere, placed next to the two we already have, but just floating in space without moving anywhere. To an observer rotating along with the first two spheres, the third one will instead appear to be tracing a circular path around the rotation axis. To explain this apparent motion, while staying in the rotating coordinate system, we need to add yet another "fake" force that only applies to (seemingly) moving objects, called the Coriolis force:
Basically, what we call the centrifugal force is the adjustment we need to make to Newton's laws to account for the fact that our reference frame is rotating, and so objects that look stationary in it are actually moving in a circle, while the Coriolis force is the further correction needed to account for the fact that not everything actually rotates along with our reference frame. (If the rotational speed of our reference frame was actually changing, we'd also need to add in an Euler force as a further correction.)
So, to answer your literal question, it depends on how we look at the system. If we look at your rotating torus and floating object in a non-rotating reference frame, then there is no such thing as a centrifugal force, and thus, of course, such a nonexistent force cannot affect your object in any way. The object simply remains motionless because there are no forces acting on it.
On the other hand, if we look at the system in a rotating reference frame, then every object (except, arguably, those whose center of mass is located exactly along the axis of rotation) is affected by the fictitious "centrifugal force" needed to compensate for the frame's rotation. For the floating object inside the rotating torus, however, this centrifugal force is counteracted (by a factor of two!) by an opposing Coriolis force that makes its apparent path in the rotating frame curve towards the axis rather than away from it, and thus keeps it at a fixed distance from the axis. But, of course, this is just a funny way of looking at the same situation as above — there are still no real forces acting on the object.
Of course, at this point you might be excused for thinking that all this messing around with imaginary forces is just a bunch of needless complications, and that it would be so much easier to just stick to non-rotating reference frames where the centrifugal and Coriolis forces simply do not exist. And you'd have plenty of company in doing so, among modern physics educators at least, who tend to go to great lengths to stress the non-existence of the "centrifugal force".
Yet there still remain many physics problem where using a rotating reference frame, with all its fictitious forces, does make both calculations and conceptual understanding easier. If you were to, say, replace the spheres in my examples with buckets filled with water, and ask what happens to the water as the buckets spin around their mutual center of mass, calculating this from first principles in a non-rotating frame would be a non-trivial exercise (especially if you tried to account for the possibly turbulent motion of the water itself). But in a co-rotating frame, the answer is simple: the centrifugal force will keep the water stable in the buckets, just as gravity would.
(And, of course, in general relativity gravity itself is really a fictitious force that only appears in non-freefalling reference frames. But we generally still prefer to treat it as a real force when doing normal everyday physics, because it's just so much easier and more intuitive.)