It is possible, but, as stated in this answer and in the links below, the errors can make the results somewhat inaccurate, and as such it is not advisable to use solely an ADXL345 to calculate velocity - unless you just want a rough approximation.
From How to use the ADXL345 accelerometer sensor, there is this note upon the determination of velocity (emphasis is mine):
The velocity along each axis can be determined by integration of the acceleration values. The double-integration of the acceleration values can determine the displacement of the object along each axis. It should be noted that integration and double-integration of acceleration values can be done only using scientific computing tools like the SciPy library in Python scripts. Even then, we have to consider errors as there can be multiple sources of error like an inconsistent sampling of data, errors in sampled data, errors due to computing, etc. Generally, displacement or velocity values can be predicted to limited accuracy and to a limited range in a user program with the ADXL345 sensor.
From Tejas Turakhia's post on Is it possible to calculate velocity and displacement from ADXL345?
It is possible to measure velocity and displacement with an accelerometer. But I advise not to use accelerometer to calculate neither the velocity nor distance, due to integral being only approximate in the code.
Because the integral will be only approximation you’ll quickly get an error in your distance and speed. Especially in distance, since to calculate that, you have to use double integral.
First acceleration is change in speed in unit time:
a = (v - v0)/t
From this we can derive that:
v = v0 + at;
To calculate the velocity, you have to periodically take measurements from the accelerometer and multiply exactly by the time difference and add it to the current acceleration:
v = v+at
The more frequently you’ll take the samples, the less error you’ll have. However, because you can’t take infinite amount of measurements between two units of time, the velocity eventually will generate an error. Most likely it won’t even go back to initial state 0.
To calculate the distance, we just use the following equation:
s = vt
And again, periodically you must calculate the distance traveled and add to the previously calculated distance:
s = s+vt
The same problem applies as to calculating velocity when calculating the distance. Because you can’t have infinite measurements between, your integral will be an approximation and will generate an error.
In practice because you would use double integral, the distance will generate the error VERY quickly, mainly because, the speed will never reach 0. It will always be something close to 0, and your distance will just drift in either direction. The more samples you’ll take and the more precise integral you’ll have the less drift you’ll have.
To avoid the drift in distance and velocity, you might want to consider using GPS together with the accelerometer. To fuse those sensors you can either use simple complementary filter or kalman filter.