One way to see a rigid body is a collection of infinity particles such that they preserve the distances between themselves (can only translate and rotate). So, we have a constraint, and then internal forces that maintain this constraint.
This internal forces are dependent on the forces that you apply in the system. If you apply a force in one point of the object (one particle), then all other points would feel a force such that the accelerations of the hole system don't destroy the constraint. Rigid bodies need to have energy stored there to do that.
If you have a static homogeneous rigid body with the center of mass $\vec{r}_{cm}=\vec{0}$, applying a force $\vec{f}(\vec{r}_0)$ in some point $\vec{r}_0$ such that the force is paralel to $\vec{r}_0$, then all the points of the body need to feel this same force to preserve the constraint. The result of this force is an aceleration of the whole system generating a translation.
If the force $\vec{f}(\vec{r}_0)$ is not parallel to $\vec{r}_0$, then all the points need to feel a force $\vec{f}(\vec{r})$ such that
$$
\vec{r}\times\vec{f}(\vec{r})=\vec{r}_0\times\vec{f}(\vec{r}_0)
$$.
because the constraint is mathematically translated to $d\vec{r}=d\vec{\theta}_0\times\vec{r}$ for every $\vec{r}$ and the same $d\vec{\theta}_0$ (see here for understand why).
With this we can define a quantity called Torque associated for a force $f$ applied to a point $\vec{r}$ of the rigid body by:
$$
\vec{\tau}=\vec{r}\times\vec{f}(\vec{r})
$$
So, if we have a force $\vec{f}_1$ applied at $\vec{r}_1$ and $\vec{f}_2$ applied at $\vec{r}_2$ we can see that the net force at point $\vec{r}$ need to obey:
$$
\vec{f}(\vec{r})\times\vec{r}=\vec{f}_1\times\vec{r}_1+\vec{f}_2\times\vec{r}_2
$$
Then we may define a net torque:
$$
\vec{\tau}_{net}=\sum_{j}\vec{f}_{j}\times\vec{r}_{j}
$$
And, if $\vec{\tau}_{net}=\vec{0}$, then the body does not rotate because at each point $\vec{f}(\vec{r})\times\vec{r}=0$ and for $\vec{r}\neq \vec{0}=\vec{r}_{cm}$ we conclude that the force $\vec{f}(\vec{r})$ is paralell to $\vec{r}$.
Torques are always calculated about some specified reference point, if you change the reference point, you change the individual torque which each force correlates to (``produces''?). If the sum of the torques about a certain point is non-zero, then changing the point may change the total torque, but if the sum of torques about one point is zero (and the sum of the forces is zero), the sum of torques about any point will be zero. Notice, that it's the sum of torques which is zero.
Now to address your first diagram, if you calculate the torques about point A, then you must consider the interaction of the walls of the hole with the rod. Those interactions produce the torques which make the sum equal to zero. If the rod is in static equilibrium, you can't ignore the effects of the walls of the hole. And you can't say that the entire hole is a point.
Edit: If the rod is secured to the wall by attaching it to the outside by sending a screw or nail through the rod, then the friction between the wall and rod, or the friction between the rod and screw (or nail) will exert a torque about A.
Regarding the second diagram, if support C is touching the rod, it exerts a force on the rod and therefore has a torque about point B. If a different point (away from B) is chosen and the rod is touching support B, then B exerts a torque. But if the system is in rotational equilibrium, the sum of the torques about a chosen point must be zero.
Best Answer
There is no "point" of contact. It is not possible for a horizontal beam with non-zero mass to be supported by a wall at a single point. The beam must have finite thickness and/or extend inside the wall. In both cases contact is made over an area. This enables forces to be exerted on the beam in opposite directions a finite distance apart, thus creating an anti-clockwise turning moment to balance the clockwise moment provided by the weight of the beam.
For example :
If the beam does not penetrate into the wall but is attached to it by a bracket at the top then this bracket must pull the beam towards the wall while the wall pushes the beam away at the bottom.
If the beam is embedded in the wall then on the underside more upward force is provided close to the face of the wall while on the upperside more downward force is provided far from the face of the wall.
The beam is supported like a shelf from below, on a bracket which is fixed to the wall in more than one place and extends some distance from the wall. The bracket provides a downward force close to the wall and an upward force far from the wall.
The beam is supported from above by a wire or rope attached to some point further up the wall, as in Horizontal rod attached to a wall. The wire provides a force upwards and inwards towards the wall, while the wall provides reaction on the beam away from the wall.