Humans evolved at a time when we lived most of our lives outdoors, and wore few if any clothes most of the year. So we COULD make vitamin D from sunlight. And that is how nature intends us to get it. Foods don't contain it naturally.
WIth the arrival of civiilization, people began to live in houses and wear more and more clothing so they got less sunlight -- and less vitamin D. In past centuries, rickets (caused by vitamin D deficiency) became very common, (particularly among urban populations who got even less sunlight). It was discovered in the 19th century that cod liver oil prevented rickets (though they didn't yet understand why -- vitamins were still a mystery), and children were routinely dosed with it.
In the 20th century, more became understood about vitamin D, it began to be added to some foods (particularly milk), and mothers were instructed to give their babies 'sun-baths' virtually from birth. A 'healthy tan' was the goal for most people, and most probably did get enough sunlight to meet their needs, with or without codliver oil.
Fast forward to late 20th-21st century, and now we are told to avoid the sun. We spend even more time indoors on our computers and in our offices, and fear of skin cancer has us covered up again with clothing and/or sunscreen when we go out. AND, scientists have decided that our RDA of vitamin D is higher than has been thought. Few of us are deficient enough to develop rickets, but less severe deficiencies are common. And with adults rarely drinking enough milk (the main food that is fortified with it) to meet our needs some doctors will recommend that their patients take supplements.
Whether to do it or not is up to you. If you drink a lot of milk and spend time outdoors, you may be fine . Your doctor can check your levels easily enough so you can make an educated decision.