Not in every case! In some countries, dating at any age might be legal but in America, we have laws against anyone older than 18 years old to be with a minor.
If you're both above the age requirement, then go for it. My parents are divorced, but they are a good example of dating at different ages. My father is now 65 years old. While my mom, she will be 41 years old in a few weeks.