Yes you are right. It is the dentin.
Enamel has got no nerves.
So when the dentist use his/her instrument, initially there is no pain (if the enamel is intact).
The next layer is dentin. As you said, dentin has got dentinal tubules containing dentinal fluid.
Whenever there is any stimulus which has not yet reached the pulp, but may have reached the dentin, ...