Sure. Businesses (in the US, anyway) pay tax on their profits, not their revenue. Profit is revenue minus expenses. Advertising is an expense, just like all of the other expenses that go into successfully bringing a product to market (research and development, transportation, etc.).