Shaun the Sheep 3D episode Shaun Goes Old-School
May 16, 2012
In the eleventh episode of the Nintendo 3DS exclusive series, Shaun is seen plaing with a Nintendo 3DS and then starts walking around and jumping in the same style as Mario in Super Mario Bros., also making the same sound effects and with the game's theme playing in the background. He also collects an apple like it was a coin, hits a bucket like a question block, and goes through barrels like they were Warp Pipes. Note that Super Mario Bros. was released for 3DS Virtual Console shortly before the release of this episode.
This is considered a Type 2 link because Shaun is implied to be playing a Mario game, but this is never directly stated, so this might actually be a Type 3 link, if the music and sound effects are considered to be there just for the viewer and Shaun is playing a generic 3DS game.
Super Mario Maker
June 03, 2016
In an update, Shaun the Sheep was added as an unlockable costume that Mario can wear using a Mystery Mushroom, when worn it replaces the sound effects with sounds from the show.
The Shaun the Sheep 3D series was licensed by Nintendo to be a 3DS-exclusive series, so the creators had the rights to include references to Mario in it.