The main ferry link between the UK and Republic of Ireland for passengers is from Holyhead to Dublin. Other routes include Liverpool-Dublin and Fishguard/Pembroke to Rosslare. This answer concentrates mainly on the Holyhead-Dublin link, primarily from to personal experience.
Trains
While there are rail connections to all the mentioned UK ports, no railway carriages are carried on board ferries. The main reason for this is that Irish railways use a different track gauge.[1] If you took a carriage onto the ferry, you couldn't take it any further than the other port. As a result, passengers travelling by railway are expected to alight the train and then embark the ferry themselves.
At Holyhead, the platforms of the railway station were placed along either side of the inner harbour[2], this allowed a cross-platform interchange between boat trains and the ferries. This arrangement survived until the late 20th century, when larger ferries (suited to roll-on-roll-off vehicle traffic) were unable to access the inner harbour, and new gantries were built in the outer harbour instead. The railway station and platforms remained in the same place, however. The gantry built for Stena Line's HSS Ferries in the 1990s was relatively near ferry terminal, and foot passengers could walk the short distance. Current ferries have gantries further out, and foot passengers are shuttled to the road deck of these ferries by a bus, and passengers then climb the stairs to the passenger deck. The bus does not sail with the ferry: it is removed before the ferry sails.
On the Irish side, there is no rail connection to Dublin Port. (The nearby port of Dun Laoghaire has a railway station, but ferries stopped serving this port in 2015.) Irish Ferries have gantries that include a gangplank for passengers to embark and disembark directly from the passenger deck, though some moorings require passengers to embark/disembark via the road deck. Stena use a shuttle bus between the ferry and the passenger terminal, as at Holyhead.
I understand that Rosslare's railway station is close to the harbour, as is Fishguard Harbour station. Pembroke Dock station is a short walk from the harbour. As above, passengers will walk from the railway station to the ferry terminal.
Buses and Coaches
There are no timetabled public bus services between the Republic of Ireland and Great Britain. There is a limited scheduled coach service[3], and some private coaches will operate. These drive onto the ferry with other road traffic, but will be subject to the same regulations as other vehicles, which require all passengers to leave the road deck and remain on the passenger deck while sailing. Passengers will presumably return to the coaches at the same time that car passengers do, on approaching their destination.
Foot Passenger Numbers in General
The growth in use of roll-on-roll-off car ferries, and cheap short-distance air travel, means that foot passenger traffic (e.g. from rail connections) is greatly reduced compared with decades ago. As this is a shrinking proportion of ferries' business, it does not warrant any significant spending on new infrastructure for foot passenger connections.
[1]: This was made law by the Railway Regulation Act of 1846
[2]: See https://www.flickr.com/photos/blue-diesels/5862917181/ for an example of how close the railway and ferries were
[3]: National Express offer coach travel between London and Dublin: https://www.nationalexpress.com/en/destinations/dublin/london-to-dublin