Do countries invest in the country's own stock market?
One example of monetary policy is the Bank of Japan buying the Nikkei as part of its asset purchasing program.

Typically, a substantial share of citizens' wealth is connected to returns of their national stock market.  Hence, it is generally not a wise move for a fiscal authority to invest public funds (not tied to pension schemes) in broad baskets of stocks.

You might try looking into sovereign wealth funds, these are typically gargantuan profit-maximizing investment vehicles wealthy nations use to acquire risky securities.