The British-Irish visa scheme only applies to visas that are issued through a joint visa application centre in China or India. It is therefore not available to you if you need to apply in the USA.
Your itinerary will therefore require you to apply for separate visas for the UK and Ireland.
As there's an open land border between Northern Ireland and the Republic of Ireland, it is possible that you can reach Dublin with being stopped even if you don't have a visa for Ireland. In that case you would almost certainly be allowed to leave the Republic by air. However, authorities will be able to deduce from airline passenger information that you must have entered Ireland without a visa, and this is likely to create problems in any future visa application to Ireland, the UK, or anywhere else they might share data with.