Yes, see https://world.mendix.com/display/refguide3/Dynamic+label+%28document+template%29
You need to make sure the HTML is valid XHTML though. When using the rich text editor this SHOULD be the case.