The first docking hatches on Earth ships were used in the Apollo program spacecraft. A schematic of the Apollo Lunar Module depicting the location of the docking hatch was stored in the USS Enterprise's library computer database. This database was accessed by the Talosians in 2254. (TOS: "The Cage", remastered)
The docking ports on board an NX-class starship were located on E deck.
In the 2270s, travel pod carrying Admiral James T. Kirk and Commander Montgomery Scott docked with the ship at a port on the engineering hull which connected directly to the cargo bay, following a long exterior tour of the vessel. Later, the Vulcan shuttle Surak docked at a port directly aft of the bridge to deliver Spock to the Enterprise. (Star Trek: The Motion Picture)
There were also docking ports which led to the torpedo bay. In 2285, a travel pod connected here to offload Admiral Kirk's inspection crew before the Enterprise departed on a training cruise. (Star Trek II: The Wrath of Khan)
On Galaxy-class ships like the USS Enterprise-D, docking ports were located on Deck 25 on either side of the forward torpedo launcher in the stardrive section. The Enterprise docked at Starbase 74 (TNG: "11001001") and Starbase 133 (TNG: "Remember Me") via these ports. The Enterprise also docked at Deep Space 9 in this manner (TNG: "Birthright, Part I"; DS9: "Emissary"), as did the USS Odyssey. (DS9: "The Jem'Hadar") Another Galaxy class starship, the USS Venture, had a docking port on the extreme port tip of its saucer section and connected to Deep Space 9 at this location. (DS9: "The Way of the Warrior", "Doctor Bashir, I Presume", "Sacrifice of Angels")
The Intrepid-class USS Voyager had three docking ports on the rim of its primary hull, which it used to dock at DS9 (VOY: "Caretaker") and a Markonian outpost (VOY: "Survival Instinct") At least one of these ports connected directly to Cargo Bay 2 and could be used to decompress the bay. In 2374, Commander Chakotay decompressed the cargo bay to eliminate the Borg drones occupying the bay during Voyager's uneasy truce with the Borg following the Species 8472 invasion. (VOY: "Scorpion, Part II")
Specialized docking ports can also be used to connect auxiliary craft directly to a starship, such as the captain's yacht on Galaxy and Sovereign class ships (Star Trek: Insurrection), the aeroshuttle on the Intrepid class, and the waverider shuttlecraft on the Nova class, all located on the ventral side of their respective saucer sections.
Commander Sisko told Doctor Julian Bashir and the ambassadors Taxco, Vadosia, and Lojal that the best place on the station to view the alien probe would be the docking ring near docking port seven. (DS9: "The Forsaken")