Enforcing option hint for a statement in a while loop is not possible
The option clause can only be used on standalone SELECT statements. 

Not where the SELECT is being used as an expression.

The following examples don't allow you to specify a query hint either.

DECLARE @I INT = (SELECT 1 OPTION (RECOMPILE))

IF (1 = (SELECT 1 OPTION (RECOMPILE))
    PRINT '1';


So you will either need to 


restructure your code so that the statement you are trying to apply a query hint to is not directly embedded inline in the WHILE (would require either repeating the statement or wrapping it in a non inline function)
set the trace flag on at the session level  
Use a plan guide (potentially - I haven't tested this)


For the specific example in your question you don't need the SELECT at all. 

DECLARE @Dummy VARCHAR(100) ='setting initial rowcount'

WHILE @@rowcount &gt; 0
  BEGIN
      DELETE TOP (10000 ) FROM [AdventureWorks].dbo.DatabaseLog;
  END 


or (as this will end up deleting all rows anyway).

TRUNCATE TABLE [AdventureWorks].dbo.DatabaseLog;