Can I compare my research work with another work published many years ago? In scientific research and publishing (as I have been told ), one should compare his work with previous published works. I am intended to compare my results (working on now in 2019) to another published in 2002(considered as a pioneer work) . Is this long time gap between these two research works acceptable in scientific community and journals ?
Have you ever published such a research paper ? 

Note: The field I am talking about is computer science .
Yes, certainly you can do this comparison. The time difference makes no difference whatever. 

However, since it has been a while in a fast changing field, you need to be sure that there haven't been advances since 2002 that you haven't considered and might make your work less valuable - even already obsolete. 

In mathematics, you can extend Euclid, if you have something new and interesting. But it has to be new by today's standards, not by his.