More than £300,000 ($550,000) of UK aid money to tackle poverty overseas was spent on global citizenship lessons in Scottish schools and it was among millions of pounds of the aid budget that was actually spent in Britain.

This included almost £12m on projects and campaigns to boost UK public support for overseas development, according to statistics published by the Organisation for Economic Co-operation and Development (OECD).

The UK, far from the worst offender in terms of spending aid funds at home, was once seen as an exception among rich countries for counting little domestic spending as aid. However, since 2009 the amount of aid spent on education and immigration services in Britain has more than doubled, from £21.4m to almost £48m in 2012 – or more than the total UK bilateral aid to Rwanda, Liberia and Mali.

The ringfenced aid budget is under renewed scrutiny this week after the prime minister, David Cameron, rejected a suggestion by the Ukip leader, Nigel Farage, that it should be raided to cover the cost of the recent flooding in south-west England, insisting that a choice did not need to be made on "either protecting our overseas aid budget or spending the money here at home".

The UK reported giving £5.4bn to developing countries in 2012, with the rest of the aid budget passed on to multilateral institutions such as the UN and World Bank. But OECD statistics (published in US dollars) suggest at least £441m in UK bilateral aid was not transferred to developing countries – an amount greater than that given to India, Afghanistan or Ethiopia, and more than eight times the UK's aid to Zambia. Most of this money – £318m – went to administering the UK aid programme, and £67m to cancelling or rescheduling debts.

A spokesman from the Department for International Development (DfID) said UK aid was spent in line with OECD rules and that there was "no reason this money can't be spent within the UK".

But few taxpayers are aware that donors are allowed to spend aid money at home and that only a certain percentage of the money that governments announce for overseas development will reach developing countries.

The UK has for years counted millions of pounds in pension payments to former British colonial officers as official development aid – and the Ministry of Defence, facing significant cuts, wants to take money from the ringfenced aid budget.

The Guardian's analysis of the OECD figures shows more than £138,000 was spent on military and security training for officials from African countries, including Ethiopia and Sudan, at the UK's Defence Academy. A further £56,000 was spent on "English language and culture training" and a "study visit" to the UK for North Korean officials.

More than £36,000 was spent on training for the chief public relations officer for the government of St Helena. No details are given in the OECD data on exactly what training this public relations officer received.

A further £12m was spent on salaries and other costs of UK experts and consultants., including almost $2,800 for a visit to North Korea by a "UK renewable energy expert".

The OECD's rules state that spending must have "the promotion of the economic development and welfare of developing countries" as its main objective in order to qualify as official development assistance (ODA). In practice, however, the rules – which are up for review this year – have allowed donors to count a range of activities.

Donors can count spending on students from developing countries in their schools and universities, for example, and the costs of supporting refugees and asylum seekers from developing countries for up to 12 months. A number of other expenses can also count, even if they do not lead to a transfer of money or resources between rich and poor countries.

Amy Dodd, co-ordinator of the UK Aid Network, said allowing donors to claim spending in their own countries risked undermining the core principle of aid – that it should be spent solely to further development and eradicate poverty. "The most effective aid is the aid that supports a country's development, not just by funding a project but also by supporting the development of local capacity or institutions, which means the aid needs to actually reach that country," she said.

Dodd said that while the UK did not count as much domestic spending as aid as other donors, it could do better.

In 2012, almost 20% of total bilateral aid from OECD donors, totalling £10.8bn, was not transferred to developing countries and was instead spent on activities in the donor country or put towards the cancellation or rescheduling of debts. For Italy and Belgium, this figure was closer to 40%; for the UK it is about 8%.

Approximately 90% of Greek bilateral aid was spent in Greece, primarily on students and asylum seekers.

Collectively, OECD donors spent more than £4.5bn ($7.5bn) in 2012 on education and immigration services in their own countries – more than their total bilateral aid to Afghanistan, India, Vietnam or any other developing country.

Among the more unusual items of spending: Norway spent almost £45,000 on activities to celebrate the 50th anniversary of Norwegian aid. Canada spent £81,000 on magazines for children about the history of the country's involvement in international development.

• This article was amended on 13 February 2014 to more accurately reflect the work of DfID.