Most games ive worked on the text is embedded in the scripts but in the form of a code tag which references an external data table which load the text on demand, so both is correct to some extent. If your writing a game you don't want to go crazy and make the entire dialog system completely data driven (unless that's your plan), that's usually a bad fit. The logic which triggers these dialog and what dialog options available are encoded in the scripts, the only thing is the raw text itself it not hard coded into the scripts rather they are held in a giant dialog table externally usually in some spreadsheet form. You can also embedded other information with the dialog text which u can extract as well, such as wild card and the like etc..
If you were ever interested in how these big AAA engines worked its well worth it to subscribe for 1 month just to get access to that. There isn't a minimum commitment like Unity so u can cancel at anytime i beleive.