Yes! Freestyle is not actually a stroke but a category in swimming competitions. The most common stroke in freestyle races is front crawl, because it’s the fastest, which is how the term freestyle has become a synonym for front crawl.
Therefore if a race specifies front crawl you have to swim front crawl, whereas if it says freestyle you can swim any stroke including sidestroke, breaststroke or butterfly. Theoretically you could do backstroke, but not in a triathlon or a medley where you have already swam backstroke.
When did people start swimming front crawl?
According to swimming.org the use front crawl stroke as a competitive swim stroke was first reported in 1844 in The Times when two Northern Native Americans, the Flying Gull and Tobacco, were invited by the British Swimming Society to give an exhibition in London. However the British were shocked by the thrashing and ‘grotesque’ style of their stroke and kept to the more ‘gentlemanly’ breaststroke for the next few decades.