Both DC and Marvel have characters whose hero name is or was Captain Marvel. The older one is the former Fawcett Comics characters that DC acquired when they bought out Fawcwett when they went bankrupt.
But, there were some legalities that DC failed to observe, such that while they were still able to call a character Captain Marvel, they could not use that name in a comic book title. That right was in Marvel's hands, and their Captain Marvel has had several incarnations, some male, and some female, including the current version of the character.
Following a trial in which DC Comics sued Fawcett Comics for breach of copyright, claiming Fawcett's Captain Marvel was too similar to Superman, the latter stopped publishing Captain Marvel in 1953. In the late 1960s Marvel gained the trademark "Captain Marvel" with their first series.
In order to retain their trademark, Marvel has published a Captain Marvel title at least once every few years since, leading to a number of ongoing series, limited series, and one-shots featuring a range of characters using the Captain Marvel alias.