You might want to travel to the UK via the Republic of Ireland. However, it is important to understand that both the UK and the Republic of Ireland are countries that are part of a Common Travel Area (CTA) and because of this there is no immigration control on arrival in the UK from the Republic of Ireland.
This can cause a problem for non-visa national students on short courses who want to apply for their visa at the UK border as the Republic of Ireland do not have the facilities to issue you with the correct visa.
You should therefore apply for your UK entry clearance (visa) in your home country if you wish to travel through the Republic of Ireland.
This is only an issue when arriving via the Republic of Ireland (for example, via Dublin). Northern Ireland is part of the UK, so if you fly directly to Northern Ireland (for example direct to Belfast), the problem does not arise.
Further detailed guidance can be found at UKCISA.