You have similar variety in English. You can certainly say
a book about cooking
to talk about many things
but you can also say
a book on cooking
a book of cooking recipes
a book on the subject of cooking
to talk of many things (of shoes and ships and sealing wax . . .)
The French sur and the English on are quite direct translations of each other, and this non-literal secondary meaning is similar.
The French de has many meanings (marquant l'origine, le lieu, la cause, la manière ou le mode d'action, la qualité), but of is one of them, while the English about brings to mind a sense of vicinity, of nearness, of maybe a lot of things all related but maybe not actually central to the subject. You have a more detailed discussion here about the implicit meanings of sur, à propos de, au sujet de and when to use one or the other. Without any context, I would probably use sur for on, and de or à propos de for about.
One thing to watch out for is that de can take other sub-meanings of of or from and by:
un livre de gymnastique --> a book about gymnastics
un livre de cuisine --> a cookbook
un livre de français --> a school book for French class
un livre de valeur --> a book of value
un livre de Victor --> one of Victor's books (a book of Victor's)
un livre de Victor Hugo --> a book by Victor Hugo (but just maybe belonging to . . . it's a matter of context and knowing that Victor Hugo is an author)
un livre sur Victor Hugo --> a book about Victor Hugo
un livre (écrit) par Victor Hugo --> a book (written) by Victor Hugo
une livre de beurre --> a pound of butter (which is a problem with livre and not with de)
Au sujet de and à propos de can be useful to resolve any ambiguity.