The competition involves four senior and four junior teams from England, Scotland, Wales and Ireland.
It is being held at Florence Court, the 18th century National Trust property which is former home of the Earls of Enniskillen.
The dog trial contest began in 1976.
For the 40th anniversary programme, the winners will be presented with replicas of the original trophies.
At its peak in the early 1980s, One Man and His Dog regularly attracted audiences in excess of eight million people. The programme was axed in 1999 after figures had fallen to about one-and-a-half million.
A series of popular Christmas specials continued until 2011 before it merged with Countryfile in 2013.
Presenters Anita Rani and Matt Baker braved the Fermanagh weather during the filming of the competition.
The trial involves herding five sheep through a series of gates, splitting them into two groups before shutting them in a pen.
The handler gives their dog commands through whistles and shouts like "come-bye", "away" and "lie down".
Ireland has won the last three competitions.
To see if Ireland can successfully defend their title, watch Countryfile on BBC One, Sunday 25 September.
The BBC Countryfile team has been filming in County Fermanagh for the final of sheepdog contest One Man and His Dog.