For the question to have a concrete answer you would have to explain in more detail how the temperature is to be measured and how the thermometer and sample interact with the surroundings. If you use a contact thermometer properly then it follows by the zeroth law of thermodynamics that the measurement recorded by the thermometer is the temperature of the sample. If equilibrium is established between thermometer and object or sample (let's call that the system), and in addition the system is thermally isolated (adiabatic) or thermally equilibrated with the surroundings, then the thermometer shows the exact temperature of the object.
A very simple example: if you measure your body temperature with a thermometer, will the temperature reading be affected by the heat capacity of the thermometer, or by equilibration? Is transfer of heat going to be a problem? Not if you wait for equilibration to complete, and for your body (the thermostat) to compensate for any transfer of heat to the thermometer and accompanying (if small) temperature change in your body. Many instruments and experiments aim to approximate thermal equilibrium as closely as possible by using insulation and/or a thermostat and/or large constant temperature heat reservoir.
In an equilibrium scenario the effect of the thermometer depends on experimental design, for instance whether the sample plus thermometer represent an isothermal or adiabatic system. As succinctly suggested in a comment, for the thermometer to report the temperature of the sample without altering it, it suffices that the experiment be carried out isothermally. This in turn requires a thermostat (e.g. thermal reservoir or heat bath) at the desired temperature, in contact with the system (including thermometer). If the reservoir is sufficiently large (has a very large heat capacity) compared to the system, or has a regulated temperature (a thermostat), then heat transfer between system and reservoir will not significantly alter the temperature of the latter once equilibrium is established, and the temperature of the system can in turn be expected to be that of the bath (surroundings). The thermometer might significantly alter other thermal properties of the system, but by careful design it should be possible to keep the system at a fixed temperature such that the thermometer accurately reports an unaltered temperature of the system. If the system is properly thermostated one might instead rely on a measurement of the temperature of the heat bath rather than directly measuring the temperature of the system. However, measuring the temperature of the system can serve to verify that it is in thermal equilibrium.
You can of course attempt to estimate the temperature of an object in a steady state situation in which heat streams through a system (consisting of sample plus thermometer), that is, there is a temperature gradient in the system. That is not an uncommon experimental setup, but is not a situation of true thermodynamic equilibrium, and is accompanied by various problems, for instance the possibility that the temperature recorded by the thermometer differs from that of the sample.