I got bitten by a dog a few years ago, could I still get rabies?

No. I assume that you got the anti-rabies shots. Rabies causes infection and is very lethal in 1-3 weeks but if you have gone this long, you are safe. And you have the benefit of some immunity from the shots you got to protect against future exposure.
Yes but not that one. A person who got bitten by a dog a few years ago did not get rabies virus from that bite, or he would have died long ago. However, he can get rabies now from a new bite by a rabid animal. The usual incubation period, from time of bite to time of rabies symptoms, is about 3 weeks to 3 months.