「と」 is used as a particle in both cases.
1.「ふりむくと、こどもたちが おおきな やまを つくっています。」
Here, the 「と」 is a conjunctive particle meaning "when" as in "When I did A, I saw B happening."
The sentence means "When I turned around, the kids were making a huge mountain."
The tense used in the original is the present, but it is the historical present, which is why I used the past tense in my translation.
2.「ぼく、トンネルを つくろうっと。」
The 「っと」 here is the quotative particle, believe it or not. The speaker is quoting himself, so to speak.
「Verb in volitional form + っと」 is a very common structure used in colloquial conversations. It is a way of making a light and casual declaration (more to oneself than to others). With this 「っと」, the speaker is often just thinking out loud.
"Alright, let's dig a tunnel here!" (Said more to oneself than to another.)