This is a movie invention. In the comics The Avengers are formed by Thor, Hulk, Iron Man and Ant-Man and the Wasp. They do so after they all individually respond to a call of Hulk attacking a train. Loki was interfering with Hulk and Earth in order to lead Thor back to himself. Whilst they start off working solo, they all eventually join together to defeat Loki and coin the name The Avengers at the end. This is all from the very first issue The Avengers Vol. 1 Issue 1 from 1963.
In fact the origin story can’t possibly be the same as in the comics the first Captain Marvel, Mar-Vell, first appeared in 1967 and didn’t originally have anything to do with The Avengers. Therefore, it wasn’t possible for The Avengers to have the same origin. Even Nick Fury didn’t have anything to do with them in the comics from the start.