PGY1 is the first year of residency, period. There are specialties - internal medicine, general surgery, family medicine, pediatrics, OB/GYN, emergency medicine, pathology - where you start with internship and simply move forward from there. But there are other specialties that traditionally begin in the PGY2 year: examples include PM&R, anesthesia, dermatology, radiology, radiation oncology, neurology, psychiatry, and ophthalmology. For these specialties, a separate first year program to provide base training is required. This can be satisfied with a preliminary medicine or surgery program, or a transitional year program. These are distinct one-year programs. They can be located at the same institution where you ultimately complete your residency, but not necessarily.
To confuse you further, some programs have integrated the first year into their curriculum, so you dont need to separately apply for a prelim year. These are termed categorical programs. Programs that still require you to complete a prelim year prior to starting are termed advanced programs. Some institutions will offer both advanced and categorical options for the same specialty.