Just writing something on dollar bills or other money is legal so if you want to write something on a dollar bill or any other money then there's nothing wrong with that.
What is illegal though is to try to add more 0's beside the numbers on the dollar bill for example it would be illegal to put two 0's in front of the 1 to make the $1.00 bill state it's a $100.00 bill.
That would not work anyway because no legit place would accept money like that just because you added some numbers to it.