I don't know whether there is a built in module that does just that. I'd suggest finding a list of tags, then writing a function like this...
def is_valid_html_tag(tag_name):
tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","br","button","caption","cite","code","col","colgroup","dd","del","dfn","div","dl","DOCTYPE","dt","em","fieldset","form","h1","h2","h3","h4","h5","h6","head","html","hr","i","img","input","ins","kbd","label","legend","li","link","map","meta","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var"]
return tag_name in tags
I think the list of valid tags depends on your doctype. These came from http://htmldog.com/reference/htmltags/. They say this list is for Strict XHTML.
That said, there may be a better way to accomplish what you're trying to do. I'm sure the friendly folks here would be happy to help if you'd like to provide more details on your goal.