According to ASTM E9 "Compression Testing of Metallic Materials at Room Temperature" it is necessary to clean the ends of the specimen and bearing surfaces with solvent. It has been suggested a lubricant such as molybond, teflon or similar low friction material be applied to these surfaces to reduce the coefficient of friction which can affect test results.
Yes a lubricant should be added. Yes it does matter because friction will cause dead metal zones to form, decreasing the strained volume, which changes the stress-strain information you wish to obtain from the test.